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())); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -