Answered by:
user login and redirect to difrent page

Question
-
User-775536502 posted
hii
i have 3 users in my site
tom
ron
jon
i have 3 pages
tom.aspx
ron.aspx
jon.aspx
how i can redirect evry user when he is login to the page ?
i am using C#
Thursday, December 17, 2015 9:35 AM
Answers
-
User1724605321 posted
Hi barakkadosh,
Will you want to use the user name as page name ? If yes , try to use below code:
Response.Redirect( txtUserName.Text +".aspx");
Best Regards,
Nan Yu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, December 21, 2015 6:14 AM
All replies
-
User1724605321 posted
Hi barakkadosh,
After user login , you could get the name of the user ,then use Response.Redirect function to redirect users to different page ,please refer to below link for details :
https://msdn.microsoft.com/en-us/library/540y83hx.aspx .
Best Regards,
Nan Yu
Thursday, December 17, 2015 9:55 AM -
User-775536502 posted
hii nan yu
this is not work for me
did you have somthing alse ?
Thursday, December 17, 2015 12:44 PM -
User1724605321 posted
Hi barakkadosh,
this is not work for meAs for this issue, if you can provide some of your code or attempts that you may have made so far, it might be easier for us to guide you and help you get what you need.
Best Regards,
Nan Yu
Friday, December 18, 2015 2:10 AM -
User-775536502 posted
hii nan yu
this is my code in the button
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Medconnectionstring"].ConnectionString);
SqlDataAdapter sda = new SqlDataAdapter("select * from Users where UserName = '" + txtUserName.Text + "' and Password = '" + txtPassword.Text + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows.Count == 1)
{
Response.Redirect("lab.aspx");
}
else
{
Label1.Visible = true;
}
}now this is the code
evry user login to direct page "lab.aspx"
i want evry user to login defrent page
Saturday, December 19, 2015 12:38 PM -
User1724605321 posted
Hi barakkadosh,
Will you want to use the user name as page name ? If yes , try to use below code:
Response.Redirect( txtUserName.Text +".aspx");
Best Regards,
Nan Yu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, December 21, 2015 6:14 AM