如何在asp.net和c#.net中写入"enter"键事件 [英] how to write 'enter' key event in asp.net and c#.net

查看:54
本文介绍了如何在asp.net和c#.net中写入"enter"键事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个登录页面,其中有两个用于输入用户名和密码的文本框,一个提交按钮,我编写了提交按钮的代码,
但是我的问题是输入用户名和密码后,如果我单击Enter键,它没有导航到登录页面如何编写Enter键事件.
谁能帮我满足我的需求.


i have a login page, in that for username and password two text boxes are there, one submit button is there and i write the code for submit button,
but my problem is after entering the username and password if i clicked the enter key it is not navigating to the loggedin page how to write the enter key event.
can anyone help me in my requirement.

推荐答案

在.aspx中添加按钮为:
add a button in .aspx as:
<asp:button id="btnLogin" runat="server" xmlns:asp="#unknown" />


选择按钮,从那里转到属性窗口,添加Onclick事件(或在设计视图中双击此按钮,它将为该按钮创建onclick通风孔.).
如果发生这种情况,您可以将控件重定向到登录后想要的页面.
如:


select button go to properties window from there add Onclick event ( or double click this button in design view it will create onclick vent for the button).
In the event you can redirect the control to the page where you want to be after logging in.
such as :

Response.Redirect("~/xyz/BranchReport.aspx")


问题是您应该多练习,这些是基本的知识,
最好直接去Google学习基础教程.


the thing is that you shoud practice more, these are basic things know,
well be freindly to google and learn basic tutorials.


尝试
http://www.dotnetfunda.com/article/article808-how-to-write-a-simple-login-page-in-aspnet.aspx [ http://msdn.microsoft.com/en-us/library/ff184050.aspx [ ^ ]
Try
http://www.dotnetfunda.com/articles/article808-how-to-write-a-simple-login-page-in-aspnet.aspx[^]
http://msdn.microsoft.com/en-us/library/ff184050.aspx[^]


您好,请从下面的链接开始.
HTML表单
Hi, please start on the link below.
HTML Forms


这篇关于如何在asp.net和c#.net中写入"enter"键事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆