禁用不实际禁用它的ASP.net文本? [英] Disabling an ASP.net textbox without actually disabling it?

查看:145
本文介绍了禁用不实际禁用它的ASP.net文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ASP.Net应用程序我有,有,从 CalendarExtender 获取日期的文本框。当填充文本框它会检查日期窗体上的另一个日期,显示一个 modalpopupextender 弹出,如果日期是错误的。但是,我不想让用户输入到这个文本框,所以当我在只读字段设置为false,并试图已启用来假的,它不允许手工录入然而,它也被禁用的回传,也不会叫框TextChanged 事件触发的 modalpopupextender
那么,有没有一种方法来禁用手工输入,而不是将其设置为只读

Within an ASP.Net application I have, there is a textbox that gets a date from a CalendarExtender. When the textbox is populated it checks that date with another date on the form and displays a modalpopupextender popup if the dates are wrong. However, I DO NOT want to allow user input into this textbox, so when I set the ReadOnly field to false and tried Enabled to false, it doesn't allow manual entry however it ALSO disabled the postback and will not call the TextChanged event to fire the modalpopupextender. So is there a way to disable manual entry and not set it to ReadOnly?

推荐答案

我想通了,只要输入安其preSS =返回false;在HTML标记中

I figured it out, simply enter onkeypress="return false;" within the HTML tag

这篇关于禁用不实际禁用它的ASP.net文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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