我剛開始玩MVC,並且遇到了障礙。我使用OpenID在每個頁面的標題上使用局部視圖作爲用戶登錄彈出窗口。當用戶點擊提供者(類似於stackoverflow)時,它進行身份驗證,然後返回到調用頁面或重定向到註冊頁面。該代碼完美工作在Firefox和Chrome下,但在IE中彈出。控制器中的「提供者」參數始終以空值發送。是否有某種錯誤涉及在IE中發佈輸入名稱/值或者我做錯了什麼?Internet Explorer發佈數據錯誤 - ASP.NET MVC
這是我的OpenID的局部視圖的樣子:
<% using (Html.BeginForm("Authenticate", "Membership", new { ReturnUrl = Request.Url }, FormMethod.Post))
{
if (!Page.User.Identity.IsAuthenticated)
{ %>
<div class="openidProviders">
Log in or join using one of these OpenID providers:
<div class="large buttons">
<div class="provider"><div><%= Html.SubmitImage("provider", "/Content/common/images/google.gif", new { value = "Google" })%></div></div>
<div class="provider"><div><%= Html.SubmitImage("provider", "/Content/common/images/Yahoo.gif", new { value = "Yahoo" })%></div></div>
<div class="provider"><div><%= Html.SubmitImage("provider", "/Content/common/images/AOL.gif", new { value = "AOL" })%></div></div>
<div class="provider"><div><%= Html.SubmitImage("provider", "/Content/common/images/OpenId.gif", new { value = "OpenId" })%></div></div>
</div>
</div>
<% }
}
%>
而且控制器邏輯是在這裏:
[AcceptVerbs(HttpVerbs.Post), ValidateInput(false)]
public void Authenticate(string provider, string ReturnUrl)
{
// Figure out provider endpoint
// Authentication function calls here
}