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

Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 12, 2011, 10:00 AM EDT
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".
Pawel Basiak3 reputationPosted Oct 12, 2011, 10:06 AM EDT
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 ShaikhRank #839 · 2.7K reputationPosted Oct 12, 2011, 10:19 AM EDT
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".
Prabhu RajaRank #861 · 2.6K reputationPosted Oct 14, 2011, 10:14 PM EDT