Asp.net mvc 4 internet Explorer中的MVC4 Html.begin提交按钮>;9不工作
我有一个用ASP.NETMVC4/Razor编写的表单。表单post在Firefox和Chrome中运行良好,但由于某些原因,在InternetExplorer10和11中,“提交”按钮没有响应。(Internet Explorer 9也很好用) 以下是视图中我的表单的外观:Asp.net mvc 4 internet Explorer中的MVC4 Html.begin提交按钮>;9不工作,asp.net-mvc-4,razor,postback,internet-explorer-10,internet-explorer-11,Asp.net Mvc 4,Razor,Postback,Internet Explorer 10,Internet Explorer 11,我有一个用ASP.NETMVC4/Razor编写的表单。表单post在Firefox和Chrome中运行良好,但由于某些原因,在InternetExplorer10和11中,“提交”按钮没有响应。(Internet Explorer 9也很好用) 以下是视图中我的表单的外观: <div class="bla"> <table style="width:100%;"> @using (Html.BeginForm("MyAction","MyControll
<div class="bla">
<table style="width:100%;">
@using (Html.BeginForm("MyAction","MyController", FormMethod.Post, new {id="myID"}))
{
<thead>
<tr>
<th class="heading highlight">Enter Registration</th>
<th>
<span style="display: block;">
@Html.EditorFor(model => model.Sign)
<input style="margin-left:4px;" type="submit" value="Save" />
</span>
<span style="display: block; font-weight: normal;">@(Model.SignDescription)</span>
</th>
</tr>
</thead>
}
</table>
</div>
我真的不知道为什么会这样
提前谢谢
编辑:
我的表单在一个表中,我忘了添加它。您不需要编写“Mycontroller”完成,请尝试在表单中仅使用前缀编写。您的标记无效-表单元素不能是表元素的子元素。重新排列您的标记,以便使用(Html.BeginForm)(将位于
中),同时确保您的用户没有禁用JavaScript。
我花了两天的时间试图弄明白为什么这在IE8上不起作用,但在其他浏览器上也没问题。我甚至不得不安装一个windows XP hyper-v,只是为了尝试重现这个问题!很可能是因为它会呈现无效的HTML。你的浏览器可能处于怪癖模式。@tisont.:指出无效的HTML如何。
>…
Im在文档模式下工作:根据F12开发工具的菜单,使用Edge(默认)。是的!!这就是问题所在!…非常感谢大家!
[HttpPost]
public ActionResult MyAction(InfoModel infoModel)
{
if(!string.IsNullOrEmpty(infoModel.Sign))
{
//do something
}
infoModel = LoadModel ();
return (indoModel);
}