复制代码 代码如下:
﹤form action=""﹥
﹤input type="text" /﹥
﹤input type="submit" value="submit" /﹥
﹤/form﹥
﹤form action=""﹥
﹤input type="text" /﹥
﹤input type="button" value="submit" /﹥
﹤/form﹥
复制代码 代码如下:
﹤form
runat="server"
defaultbutton="Button1"﹥
复制代码 代码如下:
﹤asp:Button
runat="server" Text="Button"
onclick="Button1_Click"
UseSubmitBehavior="false" /﹥
复制代码 代码如下:
TextBox1.Attributes.Add("onkeydown",
"if(event.which || event.keyCode){
if ((event.which == 13) || (event.keyCode == 13)) {
document.getElementById('"+
Button1.UniqueID+"').click();return false;}}
else {return true}; ");
复制代码 代码如下:
﹤%@ Page Language="C#"
MasterPageFile="~/MasterPage.master"
AutoEventWireup="true"
CodeFile="login.aspx.cs"
Inherits="login" %﹥
﹤asp:Content
ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server"﹥
﹤asp:TextBox runat="server"
ID="wd" ﹥﹤/asp:TextBox﹥
﹤asp:Button
runat="server" Text="提交"
OnClick="btsubmit_Click" /﹥
...........................
﹤/asp:Content﹥
复制代码 代码如下:
protected void Page_Load(object sender, EventArgs e)
{
this.Form.DefaultButton = "ContentPlaceHolder1$btsubmit";
}
复制代码 代码如下:
protected void Page_Load(object sender, EventArgs e)
{
this.Page.Form.DefaultButton = "ContentPlaceHolder1$btsubmit";
}
复制代码 代码如下:
protected void Page_Load(object sender, EventArgs e)
{
this.Form.DefaultButton = "btsubmit";
}
新闻热点
疑难解答
图片精选