您好我正在尝试使用我的datepicker onchange事件将会话变量传递给控制器。我成功地做到了这一点:
Date: <input name= "theDate" type="text" class="datepicker" onchange="this.form.action='/Controller/Action?courseID=2;this.form.method='post';this.form.submit();" />
这也有效:
@Html.DropDownList("DropDownValue", new SelectList(ViewBag.sellectedSubjects, "text"), "select one", new { onchange = "this.form.action='/Controller/Action/" + Model.StudentID + "';this.form.method='get';this.form.submit();" })
但是我想做这样的事情:
Date: <input name= "theDate" type="text" class="datepicker" onchange="this.form.action='/Controller/Action?courseID= HttpContext.Current.Session["sCourseID"]; this.form.method='post';this.form.submit();" />
我正在传递会话变量作为参数。我也想以这种方式发送多个参数。真的很感激这方面的一些帮助。感谢!!!