我有一个通过火狐显示的很好的视图,但在IE11上没有显示。
它使用“数据表”,其中两个列有按钮来切换所显示的某些数据的状态。
这些栏非常相似,其中一个是这样的.
@{
<td style="width: 18%">
@if ((ViewBag.UserIsAdmin == "1") && ("AV".Contains(Model[ix].Status[0])) )
{
<span class="hidden_span">@Html.DisplayFor(modelItem => Model[ix].StockId)</span>
string voidItemButtonCaption = String.Format("{0} {1}", ((Model[ix].Status[0] == 'A') ? "Void Item" : "Un-Void Item"), Model[ix].StockId);
using (Html.BeginForm("VoidStockItem", "Stock", new { stockId = Model[ix].StockId, categoryId = Model[ix].CategoryId, bAvailableOnly = availableOnly }, FormMethod.Post, null))
{
@Html.AntiForgeryToken()
@Html.Raw(string.Format("<input type=\"submit\" value=\"{0}\" name=\"VoidStockItem\" class=\"btn btn-default smaller_btn_btn_default\" />", voidItemButtonCaption));
}
}
else
{
@Html.DisplayFor(modelItem => Model[ix].StockId)
}
</td>
} 我发现,如果我的模型包含超过115个项目,那么在IE中视图将不会显示,它只是说“这个页面不能显示”。在IE中使用F12也没有多大帮助."DOM7011:此页面上的代码禁用了回退和转发缓存。有关详细信息,请参阅:http://go.microsoft.com/fwlink/?LinkID=291337“
经过大量的头发拉扯,我发现,如果我删除防伪令牌,页面加载正确。显然,我不能把这作为一个解决方案,但我认为这至少是一条线索。
因此,在视图中,我似乎被限制在大约230个防伪令牌上。该视图列出了股票,并允许用户取消特定的项目,因此它并不是这个世界的任何东西。
所以我的问题是..。
任何帮助都非常感谢。
发布于 2015-12-04 16:05:09
最后,我通过AJAX完成了这项工作。
它在接收AntiForgeryTokenFrom _Layout时工作得很好。
//There isn't an antiforgerttoken on this page but there is one in the _~\shared\layout so it picks that up
params["__RequestVerificationToken"] = $('[name=__RequestVerificationToken]').val();
//Set the generic params
params["categoryId"] = catId;
params["denom"] = thisdenom;
params["bAvailableOnly"] = bAvail;
if (bIsBatch) {
url = "@Url.Action("VoidStockBatch", "Stock")";
params["stockBatchId"] = itemId;
} else {
url = "@Url.Action("VoidStockItem", "Stock")";
params["stockId"] = itemId;
}
$.ajax({
url: url,
type: 'POST',
cache: false,
data: params,
success: ...........https://stackoverflow.com/questions/34072264
复制相似问题