Click here to Skip to main content
15,936,482 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is login code which I know, but I have not create any Database and I want to login and get to second page please me to modified the code

if(tbusername.text!="username") 
{
messageBox.show("Worng Username and Password");
}
else
{
messageBox.show("Correct");
}



Please help I want it should be blank and I sign in and go to next page



Thanks in Advance
Posted
Updated 20-Sep-10 2:47am
v4
Comments
Samuel Cherinet 20-Sep-10 9:14am    
are you on asp.net? if so... .net has a quick implementation library already for you, check out this link http://msdn.microsoft.com/en-us/library/ff184050.aspx
Sandeep Mewara 20-Sep-10 12:05pm    
2 things:
1. Make sure you tag your question properly. ASP.NET(for web application) or C# (for winforms)
2. If your issue gets resolved by someones answer then keep a habit of upvoting or accepting that answer. It will help you and others in future.

 
Share this answer
 
Sounds like web app you are talking of:
Try:
C#
if(tbusername.text!="username") 
{ 
   myLabel.Text = "Wrong Username or Password";
}
else
{
   Response.Redirect("~/SecondPage.aspx");
}
 
Share this answer
 
Comments
aayu 21-Sep-10 2:07am    
sorry its not web app it window app
If you are in ASP.NET I guess, it is better to use Login control for the same.

Check
http://www.asp.net/general/videos/login-control[^]

I am sure you will get how it works. :thumbsup::thumbsup:
 
Share this answer
 
Comments
aayu 21-Sep-10 2:05am    
Hey Abhishek i am getting error on this page ?
aayu 21-Sep-10 2:06am    
Sorry, an error has occurred...

Unfortunately an error has occurred during the processing of your page request. Please be assured we log and review all errors, even if you do not report this error we will endeavor to correct it.
This is the error when i click the link

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