我正在使用带有剃须刀的 mvc3 为我的项目实施 openId,我在登录页面中收到此错误:
登录.cshtml
@using DotNetOpenAuth.Mvc
@using DotNetOpenAuth.OpenId.RelyingParty
@{
ViewBag.Title = "Log On";
var options = new OpenIdSelector();
options.TextBox.LogOnText = "Log On";
}
<h2>Log On</h2>
@(Html.ValidationSummary("Login was unsuccessful. Please correct the errors and try again."))
<div id="login-oauth">
<h3>via 3rd Party (recommended)</h3>
@{ Html.RenderPartial("LogOnContent");}
</div>
<div id="or">OR</div>
<div id="login-account">
<h3>using a OnlineAB account</h3>
</div>
@using (Html.BeginForm())
{
<div>
<p>
<label for="username">Username:</label>
@(Html.TextBox("username"))
@(Html.ValidationMessage("username", "*"))
</p>
<p>
<label for="password">Password:</label>
@(Html.Password("password"))
@(Html.ValidationMessage("password", "*"))
</p>
<p>
@(Html.CheckBox("rememberMe")) <label class="inline" for="rememberMe">Remember me?</label>
</p>
<p>
<input class="classiclogon" type="submit" value="Log On" />
</p>
<p>
Please enter your username and password. @(Html.ActionLink("Register", "Register")) if you don't have an account.
</p>
</div>
@MvcHtmlString.Create(Html.OpenIdSelectorScripts(options, null))
@* @(Html.OpenIdSelectorScripts(this.Page, options, null))*@
}
“/”应用程序中的服务器错误。
编译错误
说明:在编译服务此请求所需的资源期间发生错误。请查看以下特定错误详细信息并适当修改您的源代码。
编译器错误消息:CS1501:方法“OpenIdSelectorScripts”没有重载需要 2 个参数
源错误:
Line 63: </p>
Line 64: </div>
Line 65: @MvcHtmlString.Create(Html.OpenIdSelectorScripts(options, null))
Line 66: @* @(Html.OpenIdSelectorScripts(this.Page, options, null))*@
Line 67: