简体   繁体   English

标签没有从asp.net vb背后的代码中获取价值

[英]label is not getting value from code behind asp.net vb

I using java script to load the data show in asp Label. 我使用Java脚本加载asp标签中显示的数据。 the result will be 结果将是

01/01/2016 12:00 AM - 01/25/2016 12:00 AM 01/01/2016 12:00 AM-2016年1月25日12:00 AM

When I try to use asp.net code behind to get the label result by clicking button and showing msgbox result showing me empty. 当我尝试使用背后的asp.net代码通过单击按钮并显示msgbox结果显示标签为空时,获得标签结果。

<asp:Label ID="lblreserve1" runat="server"  Visible="true"></asp:Label>

code behind 背后的代码

 MsgBox(lblreserve1.Text)
<asp:Label ID="lblreserve1" runat="server"  Visible="true"></asp:Label>

you are trying to get "text" property from an element that does not have "text" 您正在尝试从没有“文本”的元素中获取“文本”属性

you need to add the property and a value: 您需要添加属性和值:

<asp:Label ID="lblreserve1" runat="server" text="Hello World"  Visible="true"></asp:Label>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM