S
seanmatthewwalsh
Hi
I have a single login for a website, so my C# code is simply:
if (textUserName.Text.ToLower() == "admin" &&
textPassword.Text.ToLower() == "password")
{
Session["LoggedIn"] = true;
Response.Redirect("MyHome.aspx", false);
}
else
{
pResponse.Attributes["class"] = "Error";
pResponse.InnerText = "Login Failed. Please try again.";
pResponse.Visible = true;
}
I'm not sure if this is the BEST way, though. I've seen there is so
much functionality in the System.Web.Security library, but for a
simple case like this, is it worthwhile?
I get an intermittent problem where (on localhost, so far) my session
seems to expire quite quickly. I'm not sure if this is because of the
way I'm logging in, or if it's because of re-compilations while
debugging, so if the method above looks like it will create problems,
please let me know!!
Thanks
Sean
I have a single login for a website, so my C# code is simply:
if (textUserName.Text.ToLower() == "admin" &&
textPassword.Text.ToLower() == "password")
{
Session["LoggedIn"] = true;
Response.Redirect("MyHome.aspx", false);
}
else
{
pResponse.Attributes["class"] = "Error";
pResponse.InnerText = "Login Failed. Please try again.";
pResponse.Visible = true;
}
I'm not sure if this is the BEST way, though. I've seen there is so
much functionality in the System.Web.Security library, but for a
simple case like this, is it worthwhile?
I get an intermittent problem where (on localhost, so far) my session
seems to expire quite quickly. I'm not sure if this is because of the
way I'm logging in, or if it's because of re-compilations while
debugging, so if the method above looks like it will create problems,
please let me know!!
Thanks
Sean