:
- が、これは、ユーザが
In order to subscribe for the event you have to < a style=" background-color:Black; color:White; font-weight:bold;" href="@Url.Content("~/Account/Login?returnUrl=/Events/Index")">Login< /a> or create a New Account.
公衆にログインする必要があり、イベントページであることを想像してみてActionResultログイン(LogOnModelモデル、文字列returnUrl) { if(ModelState.IsValid) { if(Membership.ValidateUser(model.UserName、model.Password)) { MembershipUser user = Membership.GetUser(model.UserName);
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
&& !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
{
return Redirect(returnUrl);
}
else
{
return RedirectToAction("Index", "Account");
}
}
else
{
ModelState.AddModelError("", "The user name or password provided is incorrect.");
}
}
return View(model);
}