显示在mvc3剃刀中登录的弹出窗口 [英] displaying popup for signin in mvc3 razor
本文介绍了显示在mvc3剃刀中登录的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在为此做mvc3 razor应用程序我想显示登录页面的弹出窗口,但我得到了错误ml控制器是:
Hi all,
I am doing mvc3 razor application for this i want to display popup for signin page but i am getting errors ml controller is:
[HttpGet]
public ActionResult SigningIn()
{
if (Request.IsAjaxRequest())
{
return PartialView("_PartialSigningIn");
}
return View();
}
[HttpPost]
public ActionResult SigningIn(Account account3)
{
if (!ModelState.IsValid)
{
if (Request.IsAjaxRequest())
return PartialView("_PartialSigningIn",account3);
}
return View(account3);
}
和我的查看是:
and my view Is:
@model GoGrain.Models.Account
<h2>SigningIn</h2>
@Html.Partial("_PartialSigningIn")
和partialview是:
and partialview is:
<pre lang="sql">@model GoGrain.Models.Account
@using (Ajax.BeginForm(new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "signinginDialog" }))
{
@Html.ValidationSummary(true)
@Html.EditorForModel()
}
和jquery是:
and jquery is:
<script type="text/javascript">
$.ajaxSetup({ cache: false });
$(document).ready(function () {
$(".openDialog").live("click", function (e) {
e.preventDefault();
$("<div></div>")
.addClass("dialog")
.attr("id", $(this)
.attr("data-dialog-id"))
.appendTo("body")
.dialog({
title: $(this).attr("data-dialog-title"),
close: function () { $(this).remove() },
modal: true
})
.load(this.href);
});
$(".close").live("click", function (e) {
e.preventDefault();
$(this).closest(".dialog").dialog("close");
});
});
</script>
推荐答案
.ajaxSetup({cache:false});
.ajaxSetup({ cache: false });
(document) .ready(function(){
(document).ready(function () {
(。openDialog)。live(click,function(e){
e.preventDefault();
(".openDialog").live("click", function (e) { e.preventDefault();
这篇关于显示在mvc3剃刀中登录的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文