Re: Message not displayed

From: Sharon (talsharon_at_hotmail.com)
Date: 03/07/04


Date: Sun, 7 Mar 2004 10:22:21 +0200

Is the lable visible and enabled?

"Colin Basterfield" <colinbasterfield@hotmail.com> wrote in message
news:elKMGa9AEHA.684@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" <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
> >
> >
>
>



Relevant Pages

  • Re: Message not displayed
    ... catch (Exception ex) ... >> I have a Login screen which has a Label on it, ... >> Colin B ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Message not displayed
    ... > I have a Login screen which has a Label on it, ... > successful it clears the message and moves to the main screen, ... > Colin B ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: OWA User Authentication Problem
    ... > Hi Colin, ... >> I have created a new user who can login to workstation and read outlook. ... >> They can also login to the home page of remote workspace with no issue. ... >> Remote Workspace Group and OWA access in enabled in user properties. ...
    (microsoft.public.windows.server.sbs)
  • Re: Bypass forms authentication
    ... >> and has the Deny thing going on, ... >> add a button on the login page which allows New Users to be entered on ... >> system via a New Users page, but of course it loops round and round, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Weird behavior with /dev/mem
    ... Make netstat exempt from the policy (i.e., ... Only run netstat from contexts that are either allowed to access ... label from the context they were run from. ... login(1) login, ...
    (freebsd-current)