Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1229
  • Last Modified:

Read innerHTML

Is there any way to read the innerHTML of a label control when the page post back in C#?
0
michael1174
Asked:
michael1174
1 Solution
 
rajvjaCommented:
What do you mean by innerHTML?
Is it lable text?
Could you post a bit clear?
0
 
michael1174Author Commented:
There is a value assigned to a label control via lblControl.innerHTML.  I need to get that value and assign it a variable on a button click.
0
 
Richard QuadlingSenior Software DeverloperCommented:
Unless the same code was responsible for creating the label to start with, then not as standard.

The data returned to the server is controlled by the server and the client. It does not normally contain static elements (like lablel contents), only dynamic elements like input, select, textareas.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
silemoneCommented:
you could do this easily with javascript...

see <asp:labels = spans...

anyway, do something like

var ele = document.getElementById("<%=labelID%>");

var hidEle = document.getElementByID("<%=hidFieldID %>");
hidEle.value = ele.innerHTML;
0
 
rajvjaCommented:
But the author said to get it in PagePostBack.
0
 
silemoneCommented:
rajvia, he could technically still get it in the pagePostback...just read the hidden field then...the hidField i used is the server version...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now