Sitecore MVC控制器ActionResult不在回发时呈现布局

时间:2016-09-20 17:37:34

标签: c# asp.net-mvc sitecore

我是Sitecore MVC的新手,但缺乏示例。我认为在回发时只返回没有布局的视图。

我试着按照这个

  

Sitecore MVC Controller and Forms - ActionResult not rendering Layout on postback

但样品已经消失。

这是我的观点

    @using (Html.BeginRouteForm(Sitecore.Mvc.Configuration.MvcSettings.SitecoreRouteName, FormMethod.Post))
    {
        @Html.Sitecore().FormHandler("PatientStory","SendStory") 

          <div class="row">
            <div class="col-md-12 text-center">

            <div class="col-md-4">
                <strong>Hospital</strong>
                Name:<br/>
                @Html.TextBoxFor(m => m.HospitalName, "", new { @class = "form-control", @placeholder = "", style = "width:300px" })
            </div>
                <br/>
                <input type="submit" value="Submit">

            </div>
        </div>
    }
    }

渲染工作,以及功能和验证。只是在回发时,整个布局都消失了。

尝试了

部分查看方法

返回base.index()

我已经继承了sitecorecontroller

1 个答案:

答案 0 :(得分:0)

您可以使用

Response.Redirect(LinkManager.GetItemUrl(your item), false);

回发你想要的任何内容