MVC4 Html.BeginForm提交按钮在Internet Explorer> 9不工作 [英] MVC4 Html.BeginForm submit button in internet Explorer >9 not working
问题描述
我已经写在ASP.NET MVC4 /剃刀的形式。该表格后完美的作品以及在Firefox和Chrome,但由于某些原因,在Internet Explorer 10和11,提交按钮没有反应。 (Internet Explorer 9的作品也不错)。
I have a form written in ASP.NET MVC4/Razor. The form post works perfectly well in Firefox and Chrome, but for some reason in Internet Explorer 10 and 11, the "Submit" button is unresponsive. (Internet Explorer 9 works also good).
这是我的看法形式的样子:
This is how my form in the view looks like:
<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>
这是我的控制器:
And this is my Controller:
[HttpPost]
public ActionResult MyAction(InfoModel infoModel)
{
if(!string.IsNullOrEmpty(infoModel.Sign))
{
//do something
}
infoModel = LoadModel ();
return (indoModel);
}
我真的不知道为什么会这样...
I really have no idea why this is happening...
在此先感谢!
编辑:
我的形式是一个表里面,我忘了补充它..
My form is inside a table, I forgot to add it..
推荐答案
您的标记是无效的 - 表单元素不能是表元素的子。重新排列您的标记,以便 @using(Html.BeginForm(
将里面百分位方式&gt;
Your markup is invalid - form element cannot be child of table element. Rearrange your markup so @using (Html.BeginForm(
will be inside <th>
.
这篇关于MVC4 Html.BeginForm提交按钮在Internet Explorer&GT; 9不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!