Is the lable visible and enabled?
"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:el*************@tk2msftngp13.phx.gbl...
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" <ta*******@hotmail.com> wrote in message
news:e2**************@TK2MSFTNGP11.phx.gbl...
Can we see the code?
"Colin Basterfield" <co**************@hotmail.com> wrote in message
news:OT****************@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