I am new to Sitecore MVC and examples are lacking. I have view that when on postback only the views returns without the layout.
I tried to followed this
Sitecore MVC Controller and Forms - ActionResult not rendering Layout on postback
but the sample is already gone.
here's my view
@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>
}
}
The rendering works, as well as the function and validation. It's just that on postback the whole layout is gone.
tried
partialview method
return to base.index()
I already inherit sitecorecontroller
@html.sitecore().formhandler()
I still hope Sitecore MVP can help me with this. @MichaelEdwards If you still have your sample can you please post it again.. I checked your website..it's empty.. – CyberNinja