Click here to Skip to main content
15,896,432 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the asp.net application, if debug is mode is selected then i must bring a default username and password to the login page and display in resp textbox so that i would just click the login button and work,but in release mode i must enter my credentials and then enter the site,,,

Any idea of the code used to do this function,it would be very helpful if anyone reply at the earliest.
Posted

I do this all the time. I add values in the web.config, one for the debug mode ( true or false ) and then others for the values I want to use in debug mode ( like the user to auto log in as ). Then I write a strongly typed class that grabs these values from the web.config, and use them throughout the code.
 
Share this answer
 
Comments
KRK3290 27-Jul-12 3:24am    
cant get u,can u make it little clear
Christian Graus 27-Jul-12 3:25am    
Not really. You can add custom values in to your web.config, and I add them to store my debug mode, etc.
KRK3290 27-Jul-12 3:29am    
Thanks for ur help,if u get any info abt ths issue pls do let me knw
Christian Graus 27-Jul-12 3:40am    
I've given you all the info there is. If you have no clue how to do what I told you, then you have no clue about ASP.NET and should be in a class, not asking questions here.
KRK3290 31-Jul-12 2:19am    
Hey Graus thanks for ur help,i finished it how u said,i didnt read the solution properly while commenting the last time,sorry for that,and added to that i am still a trainee and posting some questions here will get me some knowledge and different ideas from different peoople
Add this to your form constructor, or the Load event:
C#
#if DEBUG
            tbUserName.Text = "My Debug User";
#endif
 
Share this answer
 
Comments
StianSandberg 27-Jul-12 3:08am    
5'd. Perfect solution :)
KRK3290 27-Jul-12 3:24am    
would try it

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