如何在C#中设置对子页面按钮的输入键焦点 [英] how to set enter key focus on child page button in c#

查看:92
本文介绍了如何在C#中设置对子页面按钮的输入键焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在母版页中有母版和子版关系,在其中有注销图像按钮,在子页中有文本框和GetReport按钮,可以从数据库中获取记录.我遇到的问题是,当光标在文本框中时,当我按Enter键时,然后按Enter键主要焦点将移至母版页登出按钮,而不是子页面上的按钮
因此,如何设置进入子页面上的焦点"按钮,请提供解决此问题的方法.


谢谢与问候,

Raghu.



I have master and child relationship that is in master page i have the logout image button and in child page textbox and GetReport button to get records from database here i am getting problem that is when i hit enter key while cursor is in textbox then the enter key focus is going to master page logout button instead of child page button
so how to set enter focus on child page button please give solution for this problem..


Thanks&Regards,

Raghu.

推荐答案

在chrome中检查您的页面元素ID-检查元素.
在将jQuery与母版页一起使用时,您应应用<%= id.clientId%>
for exp:
Check your page-elements ids in chrome -- inspect element.
while using jQuery with master page you should apply <%=id.clientId%>
for exp:


(``#<%= myBtn.ClientID%>'')).show()
(''#<%=myBtn.ClientID%>'').show()


我添加一个面板并将其面板属性设置为defaultbutton = childbuttonid,然后它可以正常工作.
i add a panel and set the panel property as defaultbutton=childbuttonid then it works fine.


这篇关于如何在C#中设置对子页面按钮的输入键焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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