Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 04, 2013 12:12 PM by web maintenance
All-Star
20155 Points
3328 Posts
Feb 26, 2013 09:04 AM|LINK
Hi,
You can do like this -
Place the following code in .aspx file -
<script type="text/javascript"> var MyHidden = "<%=MyHidden.ClientID%>"; </script>
Now you can use the the following in the external JS file -
html += document.getElementById(MyHidden).value;
Hope it helps u...
Member
29 Points
80 Posts
Feb 26, 2013 09:45 PM|LINK
Thanks for your help.
Feb 26, 2013 10:04 PM|LINK
Hi
I need some guidance.
Which one register I should use:
a) RegisterClientScriptBlock
b) RegisterStartupScript
34545 Points
5554 Posts
Feb 27, 2013 09:26 AM|LINK
Moises Durovni I need some guidance. Which one register I should use: a) RegisterClientScriptBlock b) RegisterStartupScript
read this description and chose the most approrpate option based on u r requirement
hope this helps...
26 Points
7 Posts
Mar 04, 2013 12:12 PM|LINK
Make the hidden field as static <asp:HiddenField runat="server" ID="MyHidden" ClientIDMode="Static"> </asp:HiddenField>. Now Call js function by it’s client value : HTML +=document.getElementById('MyHidden').value;
roopeshreddy
All-Star
20155 Points
3328 Posts
Re: passing hidden field to javascript
Feb 26, 2013 09:04 AM|LINK
Hi,
You can do like this -
Place the following code in .aspx file -
Now you can use the the following in the external JS file -
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Moises Durov...
Member
29 Points
80 Posts
Re: passing hidden field to javascript
Feb 26, 2013 09:45 PM|LINK
Thanks for your help.
Moisés
Moises Durov...
Member
29 Points
80 Posts
Re: passing hidden field to javascript
Feb 26, 2013 10:04 PM|LINK
Hi
I need some guidance.
Which one register I should use:
a) RegisterClientScriptBlock
b) RegisterStartupScript
Moisés
kedarrkulkar...
All-Star
34545 Points
5554 Posts
Re: passing hidden field to javascript
Feb 27, 2013 09:26 AM|LINK
read this description and chose the most approrpate option based on u r requirement
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
web maintena...
Member
26 Points
7 Posts
Re: passing hidden field to javascript
Mar 04, 2013 12:12 PM|LINK
Make the hidden field as static
<asp:HiddenField runat="server" ID="MyHidden" ClientIDMode="Static"> </asp:HiddenField>.
Now Call js function by it’s client value :
HTML +=document.getElementById('MyHidden').value;