KentZhou KentZhou - 1 year ago 71
ASP.NET (C#) Question

how to get value in javascript for asp Label control?

Suppose I have asp Lable set in markup like:

<asp:Label ID="myID" runat="server"></asp:Label>

then set value for this Label in code behind like:

myID.Text =100

then I want get the value 100 in javascript. I tried:


but is not working. How to resolve this issue?

Answer Source

I believe that labels render as spans. Try getting the inner text.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download