如何在aspx.cs文件中启用html文本 [英] How to Enable html text in aspx.cs file

查看:189
本文介绍了如何在aspx.cs文件中启用html文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

这是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 Attribute runat="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屋!

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