在aspx.cs页面标签不存在.. [英] In aspx.cs page label are not exist..
本文介绍了在aspx.cs页面标签不存在..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么在aspx.cs页面中labal id不存在..而且value也是
我尝试了什么:
lblID.innertext = ...
txtname.value =;
lblid中的
错误value
解决方案
确保标签上有runat =server
属性。
< asp:label id = lblID runat = 服务器 > < / asp:label >
为了获取/设置
标签<中的值 / code>控制或
TextBox
,使用文本
aspx.cs中的属性
lblID.Text = 某个值;
txtname.Text = 某些名称;
.value
和.innerText
仅适用于Javascript
,或者您应使用属性 [ ^ ]在c#中设置值
Why in aspx.cs page labal id is not exist..and "value " is also
What I have tried:
lblID.innertext=...
txtname.value="";
error in lblid and value解决方案Make sure that the label is havingrunat="server"
attribute.
<asp:label id="lblID" runat="server"></asp:label>
Inorder toGet/Set
the value fromLabel
Control orTextBox
, useText
Property in aspx.cs
lblID.Text = "some value";
txtname.Text = "Some Name";
.value
and.innerText
works only onJavascript
or you shall use Attributes[^] to set the value in c#
这篇关于在aspx.cs页面标签不存在..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文