Thursday, March 29, 2012

login error (sending data to database!)

submit button is as follows:
private void cmdSubmit_Click(object sender, System.EventArgs e)
{
if (Page.IsValid)
{
if (DBConnection(txtUserName.Text.Trim(), txtPassword.Text.Trim()))
{
FormsAuthentication.RedirectFromLoginPage (txtUserName.Text, false);
}
else
{
lblMessage.Text = "Invalid Login, please try again!";
}
}

}
is this correct? do i need to add classess an so on?
vicky

What is DBConnection method? Is it a method to check if theusername/pwd are correct? What is the problem right now? What errorsare you getting?
You may try using this:
Page.Validate();
if (Page.IsValid)
...

Regards

0 comments:

Post a Comment