Click here to Skip to main content
15,910,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
after log in I need to redirect the user to particular page, How do i do it in asp.net in c#?

How do I bind the textboxes of login user's own data from the database?(i.e., nothing but User Profile).
Posted

Example:

Session["User"] = user;//the user's own data class
Response.Redirect("profile.aspx");
 
Share this answer
 
You can do that like this..

In the Login_click, you have to write



Session["username"]=txtUsername.text;
Session["password"]=txtPassword.text;

Verify the username and password. If the user is authorized, redirect to another page like this..

Response.Redirect("Homepage.aspx");

I think it might help you.....
 
Share this answer
 
v2
Comments
sazib 9-Oct-10 8:05am    
I found this error
CS0103: The name 'userName' does not exist in the current context

if i declare session variable like this-

Session["userName"] = TextBoxUserName.Text;
Session["password"] = TextBoxPass.Text;



Please provide me a solution.
Ajith80301 9-Oct-10 11:00am    
Hi,

Can you please send the code which you have written..?? Also send the code where you use the session variable again.. I have used the same code.. I didn't get an error like that.. Let me check your code..

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