string value
-
Hi, I want to store a returned value to a hiddenField1 asp.net variable in javascript. I tried declaring the hidden field gave name but my when i tried to display the value of hiddenfield1 variable in my asp.net onclick button event it's return empty. Is it even possible to initialize asp.net variable in javascript. can somebody tell me how to do. Thanks function File1_onclick() { var HiddenField1; alert(document.getElementById("File1").value); HiddenField1=document.getElementById("File1").value; }
-
Hi, I want to store a returned value to a hiddenField1 asp.net variable in javascript. I tried declaring the hidden field gave name but my when i tried to display the value of hiddenfield1 variable in my asp.net onclick button event it's return empty. Is it even possible to initialize asp.net variable in javascript. can somebody tell me how to do. Thanks function File1_onclick() { var HiddenField1; alert(document.getElementById("File1").value); HiddenField1=document.getElementById("File1").value; }
I don't understand what you are trying to do. So, I'll give an exemple: Declare the hidden like that:
Protected WithEvents hiddenWo As System.Web.UI.HtmlControls.HtmlInputHidden
you this html in client side: In server side you could just use it like that:If hiddenWo.Value <> "" Then 'do something else 'do something end if
In client side:document.getElementById("hiddenWo").value+=2 + "|";
Hope it helps!!Just Relax And Keep It Simple.
-
Hi, I want to store a returned value to a hiddenField1 asp.net variable in javascript. I tried declaring the hidden field gave name but my when i tried to display the value of hiddenfield1 variable in my asp.net onclick button event it's return empty. Is it even possible to initialize asp.net variable in javascript. can somebody tell me how to do. Thanks function File1_onclick() { var HiddenField1; alert(document.getElementById("File1").value); HiddenField1=document.getElementById("File1").value; }
Try to use OnChange event handler instead of OnClick