在登录控制Asp.net中按Enter键时的默认按钮 [英] Default Button When Press Enter Key In Login Control Asp.net
本文介绍了在登录控制Asp.net中按Enter键时的默认按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码我想在按Enter键
This Is My Code And I Want to set Login As Default Button when Press Enter Key
<td>
<div>
<asp:LoginView ID="lgnView" runat="server">
<anonymoustemplate>
<asp:Login ID="lgnUser" OnAuthenticate="lgnUser_Authenticate" runat="server" Height="122px" Width="308px">
<textboxstyle font-size="0.8em" />
<loginbuttonstyle backcolor="#FFFBFF" bordercolor="#CCCCCC" borderstyle="Solid" borderwidth="1px" font-names="Verdana" font-size="0.8em" forecolor="#284775" />
<instructiontextstyle font-italic="True" forecolor="Black" />
<TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" />
</anonymoustemplate>
<contenttemplate>
</contenttemplate>
</div>
</td>
推荐答案
试试这个解决方案:
http://stackoverflow.com/questions/201776/ submit-login-control-button-when-i-hit-enter [ ^ ]
Try this solution:
http://stackoverflow.com/questions/201776/submit-login-control-button-when-i-hit-enter[^]
aspx页面的表单标签中有一个defaultbutton属性,您可以在其中设置登录控制id就像d efaultbutton =lgnUser
There is a defaultbutton property in form tag of aspx page in which you can set your login control id like defaultbutton="lgnUser"
If you move the panel inside the login's template:-
<asp:login id="Login2" runat="server" loginbuttontype="Image">
<layouttemplate>
<asp:panel id="Panel1" runat="server" defaultbutton="LoginImageButton">
Then it will work without code.
You can set loginbuttontype="Image" by Image,Link or button.
这篇关于在登录控制Asp.net中按Enter键时的默认按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文