设置热键 默认焦距 提交时弹出确认信息

<asp:Label ID="lblUserName" runat="server" AccessKey="U"  AssociatedControlID="txtUserName" Text="用户名(按ALT+U)"></asp:Label>

<asp:TextBox  ID="txtUserName" runat="server"></asp:TextBox>

 设置默认的焦距,在form表单中使用defaultfocus=“控件ID”

protected void Button1_Click(object sender, EventArgs e)
    {
        String scriptText = "return confirm('是否确认提交?')";

        ClientScript.RegisterOnSubmitStatement(this.GetType(),"ConfiemSubmit",scriptText);
    }
原文地址:https://www.cnblogs.com/qiushuixizhao/p/3312176.html