getting html hidden control's value in code behind
-
hi i need to get a value of html hidden control which is not set to runat server and i also dont have its id only name is getting. Request.form["refid"] is not working. so can u sugges some idea regards max
-
hi i need to get a value of html hidden control which is not set to runat server and i also dont have its id only name is getting. Request.form["refid"] is not working. so can u sugges some idea regards max
add runat="server" (from the html view) as a property of your hidden field, it will continue to work as a hidden field and it will allow you to read its value in the code behind. :~ It might have a different way to solve this issue but this worked for me. Let me know if it works for you.
-
hi i need to get a value of html hidden control which is not set to runat server and i also dont have its id only name is getting. Request.form["refid"] is not working. so can u sugges some idea regards max
Dont mistake me, i have an small doubt, did you declared the tag inbetween the
tags???? Because all other things are correct.
Know is Drop, Unknown is Ocean
-
hi i need to get a value of html hidden control which is not set to runat server and i also dont have its id only name is getting. Request.form["refid"] is not working. so can u sugges some idea regards max
-
Dont mistake me, i have an small doubt, did you declared the tag inbetween the
tags???? Because all other things are correct.
Know is Drop, Unknown is Ocean
-
If you have put the hidden field inside the form that you are posting, you can get the value using Request.Form.
--- b { font-weight: normal; }
-
it will be generated as a System.Web.UI.HtmlControls.HtmlInputHidden and you can acess (get/set) its value using: fieldName.value. David
dgonzale wrote:
it will be generated as a System.Web.UI.HtmlControls.HtmlInputHidden and you can acess (get/set) its value using: fieldName.value.
Only if you add the
runat
andid
properties to the element. Otherwise the element is treated as plain text by the server. There is no need to make a server element of it to access the value that it sends in the post.--- b { font-weight: normal; }
-
dgonzale wrote:
it will be generated as a System.Web.UI.HtmlControls.HtmlInputHidden and you can acess (get/set) its value using: fieldName.value.
Only if you add the
runat
andid
properties to the element. Otherwise the element is treated as plain text by the server. There is no need to make a server element of it to access the value that it sends in the post.--- b { font-weight: normal; }