Re: Message not displayed
From: Colin Basterfield (colinbasterfield_at_hotmail.com)
Date: 03/06/04
- Next message: Rick Strahl [MVP]: "Re: xmldocument " and ""
- Previous message: Scott M.: "Re: asp.net website slow loading"
- In reply to: Sharon: "Re: Message not displayed"
- Next in thread: Sharon: "Re: Message not displayed"
- Reply: Sharon: "Re: Message not displayed"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 7 Mar 2004 12:55:34 +1300
Yes of course:
private void btnLogin_Click(object sender, System.EventArgs e)
{
bool pwdVerified = false;
try
{
pwdVerified = VerifyPassword(txtUserName.Text, txtPassword.Text);
}
catch (Exception ex)
{
lblMessage.Text = ex.Message;
return;
}
if (pwdVerified == true)
{
lblMessage.Text = "";
// Creates an authentication ticket and attaches it to the cookie's collection of the outgoing
// response. It does not perform a redirect.
FormsAuthentication.SetAuthCookie(txtUserName.Text, true);
// Set the UserID in the session variable
Session["UserID"] = txtUserName.Text;
// Move to the Selection screen
Response.Redirect("Selection.aspx");
}
else
{
lblMessage.Text = "Invalid username or password";
}
}
Nothing much to it than that really.
Any ideas?
Colin B
"Sharon" <talsharon@hotmail.com> wrote in message news:e2RgtY3AEHA.1964@TK2MSFTNGP11.phx.gbl...
> Can we see the code?
>
> "Colin Basterfield" <colinbasterfield@hotmail.com> wrote in message
> news:OT%23uztyAEHA.1076@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I have a Login screen which has a Label on it, and if the login is
> > successful it clears the message and moves to the main screen, but if the
> > login fails due to a bad password or username the text property of the
> label
> > is assigned "bad Username or Password", however although stepping thro the
> > code it does hit that line it doesn't display the message.
> >
> > Prolly something silly but I don't what it is yet so...
> >
> > TIA
> > Colin B
> >
> >
>
>
- Next message: Rick Strahl [MVP]: "Re: xmldocument " and ""
- Previous message: Scott M.: "Re: asp.net website slow loading"
- In reply to: Sharon: "Re: Message not displayed"
- Next in thread: Sharon: "Re: Message not displayed"
- Reply: Sharon: "Re: Message not displayed"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|