手柄上输入网址密钥(ASP和VB) [英] Handle Enter Key on Website (ASP and VB)

查看:117
本文介绍了手柄上输入网址密钥(ASP和VB)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有多个ASP控件的网站。当我preSS通过登录表单进入里面,搜索功能运行,因为它的网页上找到的第一件事。

So I have a website with multiple asp controls. When I press enter inside by login form, the search function runs because it's the first thing found on the page.

我将如何处理,这样,当活动文本框是登录的形式,loginbutton code实际运行,而不是搜索按钮输入按钮。

How would I handle the enter button so that when the active textbox is for the login form, the loginbutton code actually runs rather than the searchbutton.

最后一个问题是,登录控件是一个loginview内侧,以便层次结构显示,在asp:文本框和ASP:按钮登录在里面3个标签,像这样:

One last problem is that the login controls are inside a loginview so the hierarchy shows that the asp:textbox and asp:button for logging in are inside 3 tags like so:

<loginview>
   <login>
      <logintemplate>
      //controls are here.
      </logintemplate>
   </login>

刚一说明,所有的控制是ASP和所有code是在VB pfered $ P $。谢谢
    

Just a note that all controls are asp and that all code is prefered in VB. Thanks

推荐答案

您要设置这样的窗体上的默认按钮:

You want to set the default button on the form like this:

  Page.Form.DefaultButton = "LoginButtonId"

MSDN文档:<一href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlform.defaultbutton%28VS.80%29.aspx\" rel=\"nofollow\">http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlform.defaultbutton%28VS.80%29.aspx

另外,看到一个问题,我曾在与此相关的Firefox的这个问题:<一href=\"http://stackoverflow.com/questions/6076/default-form-button-in-firefox\">http://stackoverflow.com/questions/6076/default-form-button-in-firefox

Also, see this question for an issue I had in Firefox related to this : http://stackoverflow.com/questions/6076/default-form-button-in-firefox

这篇关于手柄上输入网址密钥(ASP和VB)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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