本文介绍了发布回控制器并从控制器获取数据在部署到iis时无法在javascript中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 开发服务器它的工作但是当我在iis中部署它时状态没有保存是什么问题? 用户控制部分代码 $ .post(' / LogTable / GetVariable',功能(数据){ document.getElementById( check2)。已检查 = data.Parameters [' JetSpeed']; document.getElementById( check3)。已选中 = data.Parameters [' HeadTemp'] } 控制器部件代码 /// < 摘要 > /// 获取变量。 /// < / summary > /// < 返回 > 返回CheckBoxStates < / returns > public ActionResult GetVariable() { if (会话[ CheckBoxStates ]!= null ) { Dictionary< string,bool> checkBoxStates =会话[ CheckBoxStates] as 字典< string,bool> ;; return Json( new {Parameters = checkBoxStates}); } 会话[ CheckBoxStates] = _checkboxList; return Json( new {Parameters = Session [ CheckBoxStates] as Dictionary< string,bool>}); } 部署到iis时回复有问题。 $ b在开发服务器数据值中通过javascript调试的$ b已初始化但在iis中显示错误 以下路径中的图像 http://sdrv.ms/1dd7toW [ ^ ] 解决方案 .post(' / LogTable / GetVariable',function(data){ document.getElementById( check2)。已检查 = data.Parameters [' JetSpeed']; document.getElementById( check3)。 checked = data.P参数[' HeadTemp'] } 控制器部件代码 /// < 摘要 > /// 获取变量。 /// < / summary > /// < 返回 > 返回CheckBoxStates < / returns > public ActionResult GetVariable() { if (会话[ CheckBoxStates ]!= null ) { Dictionary< string,bool> checkBoxStates =会话[ CheckBoxStates] as 字典< string,bool> ;; return Json( new {Parameters = checkBoxStates}); } 会话[ CheckBoxStates] = _checkboxList; return Json( new {Parameters = Session [ CheckBoxStates] as Dictionary< string,bool>}); } 部署到iis时回复有问题。 $ b在开发服务器数据值中通过javascript调试的$ b已初始化但在iis中显示错误 以下路径中的图像 http://sdrv.ms/1dd7toW [ ^ ] developement server its working but when i deploy it in iis the states are not saved what is the problem ?user controll part code $.post('/LogTable/GetVariable', function (data) { document.getElementById("check2").checked = data.Parameters['JetSpeed']; document.getElementById("check3").checked = data.Parameters['HeadTemp']}controller part code/// <summary>/// Gets the variable./// </summary>/// <returns>Return CheckBoxStates</returns>public ActionResult GetVariable(){ if (Session["CheckBoxStates"] != null) { Dictionary<string, bool> checkBoxStates = Session["CheckBoxStates"] as Dictionary<string, bool>; return Json(new { Parameters = checkBoxStates }); } Session["CheckBoxStates"] = _checkboxList; return Json(new { Parameters = Session["CheckBoxStates"] as Dictionary<string, bool> });}there is a problem with posting back when deployed to iis.debugged through javascript in development server data values are initialised but in iis it shows errrorimage at following pathhttp://sdrv.ms/1dd7toW[^] 解决方案 .post('/LogTable/GetVariable', function (data) { document.getElementById("check2").checked = data.Parameters['JetSpeed']; document.getElementById("check3").checked = data.Parameters['HeadTemp']}controller part code/// <summary>/// Gets the variable./// </summary>/// <returns>Return CheckBoxStates</returns>public ActionResult GetVariable(){ if (Session["CheckBoxStates"] != null) { Dictionary<string, bool> checkBoxStates = Session["CheckBoxStates"] as Dictionary<string, bool>; return Json(new { Parameters = checkBoxStates }); } Session["CheckBoxStates"] = _checkboxList; return Json(new { Parameters = Session["CheckBoxStates"] as Dictionary<string, bool> });}there is a problem with posting back when deployed to iis.debugged through javascript in development server data values are initialised but in iis it shows errrorimage at following pathhttp://sdrv.ms/1dd7toW[^] 这篇关于发布回控制器并从控制器获取数据在部署到iis时无法在javascript中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-18 01:19