if (DropDownList1.Text == "邮箱登录")
        {
            if (CheckDomainUser(username.Text, password.Text))
            {
                err_msg.Text = "合法用户";
                Response.Redirect("main.aspx");
            }
            else
            {
                err_msg.Text = "非法用户";
            }
        }
        else
        {
            err_msg.Text=("非法");
        }
else
        {
            err_msg.Text=("非法");
        }
CheckDomainUser 这个函数没问题!!

解决方案 »

  1.   

    if(DropDownList1.SelectedValue=="邮箱登录")
      

  2.   

    Response.Redirect("main.aspx",true);
      

  3.   


    if (DropDownList1.SelectedItem.Text.Trim()== "邮箱登录")
    {
         if (CheckDomainUser(username.Text, password.Text))
         {
               err_msg.Text = "合法用户";
               Response.Redirect("main.aspx");
         }
         else
         {
               err_msg.Text = "非法用户";
          }
      }
    else
    {
        err_msg.Text=("非法");
    }
      

  4.   

    唉,只要把if (DropDownList1.Text == "邮箱登录")
    去掉就 能用,我无语
      

  5.   


    if (DropDownList1.SelectedItem.Text.Trim()== "邮箱登录")
    {
         if (CheckDomainUser(username.Text, password.Text))
         {
               err_msg.Text = "合法用户";
               Response.Redirect("main.aspx");
         }
         else
         {
               err_msg.Text = "非法用户";
          }
      }
    else
    {
        err_msg.Text=("非法");
    }