Click here to Skip to main content
15,887,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I set a value to a hidden field at run time but its value not visible in the browser so how to show it without server control like asp:label

Thanks in advance
Posted

HiddenField itself depict that it is not visible on the form,

or If you want to show hidden field value on the form,
Show it using Javascript inside any client controls i.e <span>.

You could join this thread for further details.
http://forums.digitalpoint.com/showthread.php?t=86845[^]

Please vote and Accept Answer if it Helped.
 
Share this answer
 
what is the problem in using server control..

Response.Write("your code");
 
Share this answer
 
Comments
harirg 29-Sep-10 4:17am    
i develop this web site for mobile so i remove runat="server" from form tag becuase of this i cann't use server controls
Hi,

You can get the value of hidden field like:
C#
function getValue()
{
   var hvalue = document.getElementById('<%= hdnValueField.ClientID %>').value;
   alert(hvalue);
}

Please do let me know, if you have any doubt.

Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.

Thanks,
Imdadhusen
 
Share this answer
 
Comments
harirg 29-Sep-10 4:19am    
i do not want to use alert i want to show it as text
suppose you have
element, and you have to set the hidden field value to it are as follows

C#
function getValue()
{
   var hvalue = document.getElementById('hdnValueField').value;
   document.getElementById('dvValue').innerHTML = hvalue 
}


Please do let me know, if you have any doubt.

Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.

Thanks,
Imdadhusen
 
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