Click here to Skip to main content
15,900,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir
I am using to get Value of TextBox, it is working fine ...
var ID=document.getElementById("<%=txtipdregno.ClientID%>").value;

But for Lable it is not working, Please modify it.
Also is it possible to get Value in Visible="False" condition ?
Posted
Comments
ZurdoDev 2-Apr-12 9:10am    
No, when you set Visible=False in the ASPX page, .Net does not render the control at all so you cannot get it on the client side. If you need to access a "hidden" control client side you have to use style="visibility: hidden" instead so that the control is on the client side.
[no name] 2-Apr-12 9:34am    
You should add this as a solution rather than a comment.
fjdiewornncalwe 2-Apr-12 11:37am    
I agree with Mark. This is a +5 worthy answer.

No, when you set Visible=False in the ASPX page, .Net does not render the control at all so you cannot get it on the client side. If you need to access a "hidden" control client side you have to use style="visibility: hidden" instead so that the control is on the client side.
 
Share this answer
 
Comments
fjdiewornncalwe 2-Apr-12 12:11pm    
Excellent.
var ID=document.getElementById("<%=LblID.ClientID%>").innerHTML;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900