我们如何解决Web应用程序中文本框上的Enter键注销问题 [英] How can we solved Enter key logout problem on textbox in web application

查看:101
本文介绍了我们如何解决Web应用程序中文本框上的Enter键注销问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Web应用程序中单击文本框上的Enter键时,我的系统将自动注销。经常

When I clicked Enter key on Textbox in web application, my system will logout automatically.reply

推荐答案

我遇到了同样的问题,通过以下方式解决代码。



step1:在主页面添加按钮控件。



< asp:button id =btnDisableEnterrunat =servertext =onclientclick =return false; Style =display:none; />



第2步:在主页面的表格标签中设置默认按钮。



< ; form id =form1runat =serverdefaultbutton =btnDisableEnter>





第3步:运行你的应用程序现在检查你的问题。
I have faced same issue, which is resolved by implementing below code.

step1: add button control in your master page.

<asp:button id="btnDisableEnter" runat="server" text="" onclientclick="return false;" Style="display: none;" />

step 2: set default button in form tag in your master page.

<form id="form1" runat="server" defaultbutton="btnDisableEnter">


Step 3: Run your application and check your issue now.


如果没有看到代码,我猜你有第一个元素的注销按钮(左上角)。当我们在按钮菜单中的查找按钮(通常是默认按钮)之前放置一个按钮时,我们遇到了这个问题。人们将使用表单,按回车键,然后突然出现在另一页上。



我们修复的方法是在面板中设置DefaultButton属性它被包装,或者表单对象上的DefaultButton属性。
Without seeing code, I would guess that you have the log out button as the first element (top left). We have that problem when we have a button placed before the "find" button - which is usually the default button - in our "button menu". People will be using the form, press enter and all of a sudden be on a different page.

The way we fix is to either set the DefaultButton property in the panel that it's wrapped in, or the DefaultButton property on the form object.


这篇关于我们如何解决Web应用程序中文本框上的Enter键注销问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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