Reading int from a hidden field in .aspx
Posted
by vikp
on Stack Overflow
See other posts from Stack Overflow
or by vikp
Published on 2010-05-24T17:44:37Z
Indexed on
2010/05/24
17:51 UTC
Read the original article
Hit count: 256
Hi,
I'm struggling to read an int from the hidden field on aspx page.
<input type = "hidden" id = "myIntegerId" name = "integerId" value= "<%: Model.MyObjectId %>" runat = "server" />
The value is definately on the form, I can see it in the debugger and print it with <%: %>
When I read the form values in the controller, instead of an int I recieve a following string: <%: Model.MyObjectId %>
I have tried casting data in the hidden field to string and calling ToString() method on that field, neither has worked.
The data is submitted using the post event.
I have a feeling that I'm missing something very basic...
Any help is greately appreciated.
Thanks
© Stack Overflow or respective owner