Hello,
I'm using forms authentication with active directory.
if (domainProvider.ValidateUser(txtUsername.Text, txtPassword.Text))
{
FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, false);
}
How can I pass the value from txtUsername.Text to default.aspx so I can use it to query a SQL server database for the first name/last name etc.
Thank you!
Loading
Prabhu RajaPosted Oct 15, 2011, 2:14 AM
Javeed M ShaikhPosted Oct 12, 2011, 2:19 PM
1. string s = Request.Form["txtUserName"].ToString();
2. TextBox txt = (TextBox)Page.PreviousPage.FindControl("txtUserName");
3. Use FormsAuthentication ticket.
Please do not forget to mark "Accepted Answer".
Pawel BasiakPosted Oct 12, 2011, 2:06 PM
The authentication is/was working properly.
I would like to pass the username value from login.aspx to default.aspx.
Are session variables the way to go for this?
Javeed M ShaikhPosted Oct 12, 2011, 2:00 PM
Please make the following change in your Web.Config file according to your needs the page name can change.
Please do not forget to mark "Accepted Answer".