|
Hi,
You have to give the ip address or server name provided by your service provider in the connection string...,with out this you can not establish the connection to the server
|
|
|
|
|
|
Subin Alex wrote: Most of my friends use the ip address of the web server,is it a gud practise or there is any other way?
This is depends where you DB server is. Your friend use IP Address of Web server as DB server, because of they have hosted Database and Web Sites in a Same System.
Subin Alex wrote: is it a gud practise or there is any other way?
It depends on requirements and application. If its very small application then its fine. for large organization they always keeps it different.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hi,
I have used AJAX ModalPopup Extender in my site but there is a design issue that the Popup window appears on the left top corner and it is only partially visible in Internet Explorer but it is fine in Mozilla.
In mozilla it is in center.
And I need compatibilty for both browsers.
Can somebody help me out what is the exact problem is???
|
|
|
|
|
Hard to say without seeing code, but if it doesn't work in IE, then I assume that you're doing something wrong.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Christian,
When i am setting dispaly style of my popup panel as
asp Panel ID="PnlTmpPart" runat="server" Width="600px"
style="vertical-align: middle; text-align: center; margin-top: 600px; margin-left: 1000px;" Height="450px"
then it is appearing properly in Internet Explorer but then it is disturbed in Mozzila.
So i think it is typical design issue.
Hope now you get my problem
|
|
|
|
|
OK, sounds like you just need to work out how to get your HTML right. You know you can write code that runs differently based on the host browser ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Ya but i have to search as i havnt used it in this project
can u hav that code right now.
Plz send it to me
Thanks alot.
|
|
|
|
|
i have included mail delivery code in my project. the problem is that,its sending mails to gmail account successfully without delay.But is unable to send mails to other mail accounts like yahoo,in etc.
How can i solve that.
|
|
|
|
|
deepthy.p.m wrote: How can i solve that.
Have you looked at the bulk/spam folders? Yahoo might have marked the message as spam.
|
|
|
|
|
but in in.com i didn't get that mail.but in yahoo.com its in the span .How can i send directly to inbox in all accounts.
|
|
|
|
|
deepthy.p.m wrote: its in the span
span?
deepthy.p.m wrote: How can i send directly to inbox in all accounts.
Show us the code you are using for sending mail.
|
|
|
|
|
You can't control how a mail provider decides what is spam, if you could, it would be pointless. Whenever the mail is not arriving, you have an issue with your settings and the mail provider, not an ASP.NET question.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
Credentials of which mail server you are providing i.e. which smtp server you are using for sending mail???
I think it is gmail.
|
|
|
|
|
i use localhost mail server
SmtpMail.SmtpServer = "localhost";
|
|
|
|
|
Actually what we do in such conditions while making some mail sending code. We provide the credentials of our mailserver and then through a mail id of our domain we can send mail to any server whether it is gmail or yahoo.
Just while sending your mail code apply break and catch the exception. You will see that most probably these mails were rejected by the servers on which you are sending the mail.
Which port and emailid you have provided in your code.
|
|
|
|
|
This is because most mail accounts like yahoo, msn ect.. have numerous checks like reverse dns to ensure that the emails being sent to them are coming from a fully qualified domain name. If your local computer doesn't have a fully qualified domain name and does not have a reverse dns setup then you may need to send your mail from a remote email server that has that criteria.
Hope this helps.
|
|
|
|
|
i'm trying to restrict one user to be logged in only once .if he tries to log in to the system using his same username while logged in i want to restrict it , i use the session , and trying to catch if the user is already logged in by setting
this.session[user.usrname]=user.usrname;
but when i try to log in system by using the same username it doesn't give any exception. the session mode is InProc .
|
|
|
|
|
I don't see the code where you try to catch that the user is already logged in, only where you set it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You can use Database in this scenarios. When user logged in first time, enter the user id/ user name into the database. And this database should be checked every time when any user logging into the system, if the user id is already there, give a message that 'some one is already logged in with same credentials'.
Note : you have to clear the database entries when user log off the system,close the browser etc.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
tanx for your kind reply, now i want to clear whether i'm having a correct idea about the session.
when a user logged on to the system i'm trying to keep it in the session.what i want to know is whether the server keeps a collection of session objects to keep the information related to the logged on users.
and in the previous code session gets a key and a value, so when we set the same key it should give an exception like hash table, isn't it
|
|
|
|
|
prasadbuddhika wrote: what i want to know is whether the server keeps a collection of session objects to keep the information related to the logged on users.
For every client Session data store separately, means session data is stored as per client basis.
prasadbuddhika wrote: and in the previous code session gets a key and a value, so when we set the same key it should give an exception like hash table, isn't it
No. The code which you have provided is not doing this at all.
Mine was a alternative approach.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
|
Hello there people I'm working on an ASP.NET website using C# code on VS 2005. My problem is that when using the Login controls like the Registration Form, Login Control, Login Status, Change Password, etc, I don't want the project to create a .mdf file. So, I made a connection string in the web.config file to use my SQL Server 2005 database. The problem is how could I make this kind of registration type of site? I've tried searching tutorials but with no success. I want the site to be able to handle registrations and logins using my SQL Server 2005 database
Website type is: Shopping Cart.
Problems I'm encountering:
1. I need to know how to use login controls using an SQL Database which is not created automatically.
2. I need to know hot to tackle permissions, like I have the main site to be available to non-registered users and registered users but I don't want anyone to access the Administration site.
File Structure:
Folder -> Administration
Admin.aspx
UserList.aspx
Folder -> App_Code (to store the code of the cart/other functions
Code.aspx
Folder -> App_Data (not used because I want to use an external Database)
Folder -> App_Themes (to store stylesheets)
Folder -> Images to store all the images
Folder -> Catalog (contains the products cathegories)
Folder -> Login
Login.aspx
Register.aspx
ChangePW.aspx
RecoverPW.aspx
RecoverPWConfirmation.aspx
Default.aspx
MasterPage.master
Admin.master
I'm Using two master pages, one for the whole site, and one for the administration.
I want to use the main login with a hard coded admin privileged user in the database to access the administration and no-one else.
My DB has a table named user Permission where it has the PermissionID(PK)(1, 2), PermissionType(User/Admin) and have a table named Clients with the Client ID(PK), Name, Surname, PermissionID(FK)
So far this is the code I used for the Web.Config File
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.net>
<mailsettings>
<smtp deliverymethod="PickupDirectoryFromIis" from="Admin@ImagineComputers.com">
</smtp>
</mailsettings>
</system.net>
<appsettings />
<connectionstrings />
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<rolemanager enabled="true" />
<!--
Role manager is used so that users can have certain
privelages and Administrators have all privelages
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
<!--
Mail settings used for online server
-->
<!--<mailSettings>
<smtp>
<network host="my.mail.server" />
</smtp>
</mailSettings>-->
</configuration>
And this is the code of the master page:
<![CDATA[<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>]]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="App_Themes/StyleSheet.css" rel="stylesheet" type="text/css" />
<title>Test Computers</title>
</head>
<body>
<form id="form1" runat="server">
<center>
<div id="topContent">
<table id="topTable" cellspacing="0" cellpadding="0">
<tr>
<td>
<br />
<br />
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</center>
<center>
<table id="mainContent" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="leftContent">
</td>
<td id="middleContent">
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server" xmlns:asp="#unknown">
</asp:contentplaceholder>
</td>
<td id="rightContent">
<asp:loginname id="LoginName1" runat="server" style="position: static" xmlns:asp="#unknown" />
<asp:loginview id="LoginView1" runat="server" xmlns:asp="#unknown">
<rolegroups>
<asp:rolegroup roles="Admin">
<contenttemplate>
<a href="Administrator/Administration.aspx">Admin Page</a>
</contenttemplate>
</asp:rolegroup>
</rolegroups>
</asp:loginview>
<asp:loginstatus id="LoginStatus1" runat="server" style="position: static" xmlns:asp="#unknown" />
<br />
<br />
<img src="Images/Site/cart.jpg" alt="Cart" style="float: left;" id="imgCart" />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Items:
<br />
Price:</td>
</tr>
</table>
</center>
<center>
<div id="bottomContent">
</div>
</center>
</form>
</body>
</html>
I hope this long question is not too bad for someone to help me. I thank you beforehand!
Regards,
Francesco (Junior Programmer :] anxious to learn)
|
|
|
|
|
Hi there!
I've just been doing the same thing as you and ended up with creating my own registration system.
Mostly because thats what I'm used to from the days of standard ASP and include files.
Basically I created an object called SessionContainer that I store in a session variable which contains a bool value that tells me if the current user is logged in or not (IsSignedIn).
This container also contains the signed in user (if signed in).
I then created a object that inherits from System.Web.UI.Page and all the pages in my sites inherits this object.
And the object has a public property so I can access the SessionContainer.
So in your administration pages you can just check IsSignedIn, if false then redirect to something else..
And yeah I got two master pages, one named defaultMaster (for non-secure pages) and another nested masterpage named secureMaster.
secureMaster checks the level of security for the current page (None, ReadOnly or Restricted). So I can set the level of security on each page.. Some pages I let the user read but not write and some pages are off-limit to non-signed in users.
You dont need two different masterpages, but I needed some design changes in the secure pages so I ended up with this solution.
Sorry for the poorly description, but maybe you get the idea.
If not I could easily create a little project for you to look at and play with.. Just let me know and I'll throw something together.
I'm not saying that my way is the only way, but it works
|
|
|
|