在弹出窗口中重新加载局部视图

时间:2012-12-02 15:07:35

标签: asp.net-mvc devexpress

我使用mvc devexpress 我的问题是: 当我在ajax的模态弹出窗口中重新加载partialview时 之后,除了partialview之外的所有内容都会删除

,我想要包含部分视图的弹出窗口 我可以通过点击(弹出窗口中的按钮)和ajax来刷新局部视图,并在点击并刷新局部视图后弹出保持打开状态, 我想在弹出窗口刷新部分视图,弹出窗口保持打开状态:(

请帮帮我 这是我的代码

@Html.DevExpress().PopupControl(
                            settings =>
                            {
                                settings.Name = "GetDatepopUp";
                                settings.PopupElementID = "GetDate";
                                settings.PopupAction = PopupAction.LeftMouseClick;
                                settings.CloseAction = CloseAction.CloseButton;

                                settings.Modal = true;
                                settings.ShowShadow = true;
                                settings.ShowFooter = false;
                                settings.ShowHeader = true;
                                settings.PopupAnimationType = PopupAnimationType.Slide;
                                settings.Width = 50;
                                settings.Height = 50;
                                settings.AllowDragging = false;
                                settings.EnableAnimation = true;
                                settings.ShowLoadingPanel = true;
                                settings.ShowOnPageLoad = false;
                                settings.SetContent(() =>
                                {
                       @Html.RenderPartial("CalenderContainerPartialView", "Message");
                                });

                            }).GetHtml()

  ***************************************************************
  @using (
  Ajax.BeginForm(
   "CalenderContainerPartialView",
   new AjaxOptions 
    { HttpMethod = "Post", 
      UpdateTargetId = "PartialToRefresh",
      InsertionMode = InsertionMode.Replace 
    }
   ))
  { 
  @Html.TextBox("Name");
  @Html.DevExpress().Button(
                            settings =>
                            {
                                settings.Name = "chkfffff" ;
                                settings.Text = "test";
                                settings.UseSubmitBehavior = true;
                            }).GetHtml()
  }
 <br />
 <div id="PartialToRefresh">
   @{Html.RenderPartial("Calender");}
 </div>

2 个答案:

答案 0 :(得分:0)

您可以使用内置的PopupControl回调来实现此目的。

请查看有关此问题的this演示。

答案 1 :(得分:0)

改变

<强> @Html.RenderPartial("CalenderContainerPartialView", "Message");

<强> Html.RenderPartial("CalenderContainerPartialView", "Message");

发现于: http://www.devexpress.com/Support/Center/Question/Details/Q353474