c# - How to get hidden value from Form when i try to get value on controller value zero always -
@html.hiddenfor(x =>x.streamid, model.streamid) @html.labelfor(m => m.streamid) <select id="streamlist" name="list" onchange="ddlstream();"> @for (int = 0; < @model.dtforstream.rows.count; i++) { <option value="@model.dtforstream.rows[i][0]">@model.dtforstream.rows[i][1].tostring()</option> } </select> <p><input type="submit" value="create" /></p> function ddlstream() { var k = $("#streamlist").val(); $("#sid").val(k); alert(k); } could try this? $("#streamid").val(int.parse($("#streamlist option:selected").val()));