刚从asp转到asp.net,碰到一个怪问题从登陆画面转到confirm页判断是否有用户如有就到INDEX页,但是现在在登陆画面按button没反应老是停留在本页望各位高手给看看
这个是登陆页面pLogin.aspx里代码
<form id="form1" runat="server"  >
    <div>
        <asp:TextBox ID="txtPWD" runat="server" Style="z-index: 100; left: 460px; position: absolute;
            top: 117px" TextMode="password" ></asp:TextBox>
        <asp:TextBox ID="txtUID" runat="server" Style="z-index: 101; left: 459px; position: absolute;
            top: 74px"></asp:TextBox>
        <asp:Label ID="Label1" runat="server" Style="z-index: 102; left: 407px; position: absolute;
            top: 122px" Text="密 码" Font-Bold="True" Font-Names="楷体_GB2312"></asp:Label>
        <asp:Label ID="Label2" runat="server" Style="z-index: 103; left: 406px; position: absolute;
            top: 77px" Text="用户名" Font-Bold="True" Font-Names="楷体_GB2312"></asp:Label>
        <asp:Button ID="cmdLog" runat="server" Font-Bold="True" Font-Names="楷体_GB2312" Style="z-index: 104;
            left: 486px; position: absolute; top: 172px" Text="登 录" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUID"
            ErrorMessage="用户名不能为空" Style="z-index: 105; left: 645px; position: absolute;
            top: 75px" Width="116px"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPWD"
            ErrorMessage="密码不能为空" Style="z-index: 106; left: 648px; position: absolute; top: 120px"
            Width="99px"></asp:RequiredFieldValidator>
    
    </div>
</form>
下面是confirm.asp.cs主要代码
    protected void Page_Load(object sender, EventArgs e)
    {
        DataSet Ds = new DataSet();
        string UID;
        string PWD;
        UID = Request["txtUID"];
        PWD = Request["txtPWD"];
        Response.Write(UID);
        SqlConnection Cn = new SqlConnection();
        SqlCommand Cmd = new SqlCommand();
        SqlDataAdapter Da = new SqlDataAdapter();
        Cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Initial Catalog=etam;Data Source=HUAFLY";
        Cn.Open();
        Cmd.Connection = Cn;
        Cmd.CommandText = "select AgentID from EL_AgentAcount where AgentID=" + UID + " and PWD='" + PWD + "'";
        Da.SelectCommand = Cmd;
        Da.Fill(Ds, "UID");
        if (Ds.Tables[0].Rows.Count == 0)
        {
            Response.Write("用户名或者密码错误,按<a href='pLogin.aspx'>这里</a>返回");
        }
        else
        {
            Response.Redirect("index.htm");
        }
    }

解决方案 »

  1.   

    事件丢失了吧,好像是.net2003的bug,不知道2005有没有解决
      

  2.   

    不要有asp那样的老习惯了,直接在一个页面做这个操作就可以了,推荐你先看看快速入门
    http://www.cndigs.com/search.php?search=asp.net&tag=true再就是注意验证控件的用法,验证控件很容易引起提交没反应的问题
      

  3.   

    看看是否是事件丢失!
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Button1.Click += new System.EventHandler(this.Button1_Click);
    this.Load += new System.EventHandler(this.Page_Load); }
      

  4.   

    同意楼上的。加上看网站根:aspnet_client文件在不?