Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir in web.config i have given credentials username and password,how i have to write the login .aspx page..
Posted
Comments
Sebastian T Xavier 9-Jul-12 3:11am    
why re-post?

Please don't.
Never store sensitive info in web.config.
Look at using the .NET Membership system instead - it will do most if not all of teh work for you, and will be a lot more secure:
Introduction to Membership[^]
 
Share this answer
 
You can get value of web.config by using following code,

C#
String username = ConfigurationManager.AppSettings["username"];
String password = ConfigurationManager.AppSettings["password"];
 
Share this answer
 
You can check the entered user name and password with web.config file and redirect the next page

C#
protected void LoginButton_Click(object sender, EventArgs e)
     {
         System.Web.Configuration.FormsAuthenticationUser formsAuthenticationUser = new System.Web.Configuration.FormsAuthenticationUser("mahesh", "mahesh");
         if(LoginUser.UserName.Equals(formsAuthenticationUser.Name) && LoginUser.Password.Equals(formsAuthenticationUser.Password))
         {
             Response.Redirect("~/Account/Register.aspx");
         }
     }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900