Click here to Skip to main content
15,905,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i have a login page...it contain two textbox...txtusername and txtpassword...when i click on enter button on textbox then it redirect to home page...master page have a form tag..but login page dont have form tag....please help me...i think some problem form tag....
Posted
Comments
Sushil Mate 17-Oct-12 0:02am    
whats the problem?
Sarvesh Kushwaha 17-Oct-12 0:22am    
what is the problem ... please mention clearly ..
Ambesha 17-Oct-12 1:32am    
What problem you are getting please be sepecific..

If you are posting the values of those two text boxes, then from the code behind you can get the values of them by using txtusername.Text and txtpassword.Text respectively.

If you are redirecting to another page on the click event, then to use the values on that page you will first need to store them somewhere such as the Session. Here's a simple example:

Code in the button's click event to store values in the session:
C#
Session["username"] = txtusername.Text;
Session["password"] = txtpassword.Text;


Code used to get the values from the session on another page:
XML
string username = (string)(Session["username"] ?? "");
string password = (string)(Session["password"] ?? "");


Here's a good reference for sessions: Exploring Session in ASP.NET[^]
 
Share this answer
 
hi i solved it....master page contain form tag runat="server"...but in login page no form tag...so i delete master page form tag and replace it on login page....bcoz of tat only when i click on textbox it going to the home page....
 
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