HTML 控件 asp.net
我正在开发应用程序,我已经设置了一些 html 控件,这些控件在代码后面的 runat="server" 上我需要更改那里的文本,我制作了 htmlcontrol[] 数组,其中包含这些控件,现在我面临的问题是它没有显示我的文本属性,以便我可以动态更改文本 我的代码是
HtmlControl[] htmlctrl = { ctl1,ctl2,ctl3,ctl4 };
foreach (HtmlControl ctl in htmlctrl)
{
}
任何人都可以帮助我吗?
i am developing application and i have set some html control which are runat="server" on code behind i need to change there text,i made htmlcontrol[] array which contain those control now the problem which i am facing that it didn't showing my text property so that i can change there text dynamically
my code is
HtmlControl[] htmlctrl = { ctl1,ctl2,ctl3,ctl4 };
foreach (HtmlControl ctl in htmlctrl)
{
}
Can anyone help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须将 html-control (即文本框)类型转换为 TextBox,才能显示 Text 属性。
you must type-cast html-control (which is textbox) to TextBox, in order to get Text property shown.