473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Message not displayed

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
Nov 18 '05 #1
4 956
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

Nov 18 '05 #2
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


Nov 18 '05 #3
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


Nov 18 '05 #4
Now I'm feeling stooopid, Visible was set False...I always assume it's
complicated...

I'll get me coat. :-)

thanks,
Colin
"Sharon" <ta*******@hotmail.com> wrote in message
news:uW*************@tk2msftngp13.phx.gbl...
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



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew Baker | last post by:
OK this has me perplexed, puzzled and bamboozled! I have a remoting service which I displayed a message box in. I then wondered what would happen if a client made a call to the service while the...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
8
by: Ravi Ambros Wallau | last post by:
Hey guys: What can I do when an "Error Creating Control" is displayed on the form (instead of the control), and a tooltip indicating the error never is displayed? Is there some log, some hidden...
2
by: jburkle | last post by:
The following is the onclick method called when the "Renew" button is clicked by the user in my Windows application: ..... Private Sub cmdRenew_Click(ByVal eventSender As System.Object, ByVal...
12
by: jburkle | last post by:
Hello all, I am still having an issue where multiple Message Boxes are being displayed to the user from the same form at one time. This issue hides the boxes behind the forms since the forms take...
2
by: rdemyan via AccessMonster.com | last post by:
I have a custom message form that I want to display when the user shuts down my app. Some clean up needs to be done during shutdown and I want to display this form and then display various...
2
by: sasierkha | last post by:
I have two options yes and no in option button when the user select the option yes it has two textbox with required field validator if value is entered no pbm otherwise error message will be...
0
by: dudeja.rajat | last post by:
Hi, I'm working on Windows Platform I'm facing some problem with the tkMessageBox. My code is as below: import tkMessageBox import Tix from Tkinter import * if len(installedLibPath) !=...
0
by: Guilherme Polo | last post by:
On Thu, Aug 28, 2008 at 10:29 AM, <dudeja.rajat@gmail.comwrote: It is good to post a short code sample that demonstrates the problem, but it has to run by itself at least. tkMessageBox...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.