我遇到了一个错误。尽管声明了变量(故障文本和用户名)错误仍然出现。谁能帮帮我吗?
- Use of Unassigned local variable "FailureText"
- Use of Unassigned local variable "UserName"
protected void Login1_LoginError(object sender, System.EventArgs e)
{
TextBox FailureText;
TextBox UserName;
//There was a problem logging in the user
//See if this user exists in the database
MembershipUser userInfo = Membership.GetUser(UserName.Text); // errors appear here
if (userInfo == null)
{
//The user entered an invalid username...
//error appear here ( failuretext.text)
FailureText.Text = "There is no user in the database with the username " + UserName.Text;
}
谢谢 (: