如何在C#中取消选择文本框值 [英] how to deselect textbox value in C#

查看:107
本文介绍了如何在C#中取消选择文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我创建了一个文本框Usercontrol。我不希望选择来自DB的文本框值。假设我的文本框值为管理员来自数据库。所以我希望文本框能够集中,但不应该选择文本框值。任何人都可以告诉我如何在asp.net中实现这一点。

Hi,

I have created a textbox Usercontrol.I do not want the textbox value which is coming from DB should be selected.Suppose my textbox value is "Admin" which is coming from database.So i want the textbox to be focused but the textbox value shouldn't be selected.Can anyone tell me how to achieve this in asp.net.

推荐答案

请参阅此答案: http://stackoverflow.com / questions / 794583 / deselect-contents-of-a-textbox-with-javascript [ ^ ]。



-SA
Please see this answer: http://stackoverflow.com/questions/794583/deselect-contents-of-a-textbox-with-javascript[^].

—SA


将输入字段标记为只读。

然后尝试在ASP.NET TextBox控件中聚焦和选择文本 [ ^ ]
Mark the input field as readonly.
Then try Focusing and Selecting the Text in ASP.NET TextBox Controls[^]


这篇关于如何在C#中取消选择文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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