如何在aspx.cs文件中启用html文本 [英] How to Enable html text in aspx.cs file
问题描述
大家好,
这是Samar,在asp.net开始我的职业生涯,这是我的第一篇文章。
* I有任务在html文本框中显示信息,我在页面onload上设置了html文本框属性,如下所示。
< input type =textid = txtinfodisables =disabled
*现在我需要通过在aspx.cs文件中设置html textbox属性来显示保存数据的信息
任何人都可以帮助我如何在aspx.cs文件中启用该属性
谢谢,
SAMAR
只需添加属性runat =server
< 输入 type = text id = txtinfo runat = server / >
在你背后的代码中可以这样做。
txtinfo.Disabled = 真跨度>; // 禁用文本框
txtinfo.Disabled = 假跨度>; // 启用文本框
嗨Karthik,
非常感谢。它工作了
谢谢,
Samar
Hi All,
This is Samar,Beggning my career in asp.net and this is my first post.
*I have task to show information in html text box,I had set the html textbox property disabled on page onload as below.
<input type="text" id="txtinfo" disables="disabled"
*Now I need to show information as data saved by setting html textbox property as enabled in aspx.cs file
Can any one help me how can I enable the property in aspx.cs file
Thanks,
SAMAR
Just Add an Attributerunat="server"
<input type="text" id="txtinfo" runat="server" />
in the code behind you can do like this.
txtinfo.Disabled = true; // disable the textbox txtinfo.Disabled = false; // enable the textbox
Hi Karthik,
Thank you very much.It worked
Thanks,
Samar
这篇关于如何在aspx.cs文件中启用html文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!