I have a simple ASP.net mvc webite which using Jquery tabs to layout the content. In one of the tabs I render a PartialView which is bound to its own model which allows the user to update their system setup details. Here is a portion of the partialview being rendered:
<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(of SystemSetupViewModel)" %>
<% Using Html.BeginForm("UsrCtlSystemSetup", "User", FormMethod.Post)%>
<%: Html.ValidationSummary(True, "Invalid details supplied.")%>
<div class="tabDynamicHeight ">
<div class="FormFullRow formLayoutLabel">
<div class="Seperator">
<div class="FormFullRow longInput">
<%: Html.LabelFor(Function(model) model.WebsiteAddress)%>
<%: Html.TextBoxFor(Function(model) model.WebsiteAddress)%>
<%: Html.ValidationMessageFor(Function(model) model.WebsiteAddress)%>
</div>
<small class="helpText FullRow">Your Companies Website Address.</small>
</div>
</div>
<div class="FloatButtonLeft">
<input type="submit" value="Save" class="FloatButtonLeft BlueBtnMedium" />
</div>
</div>
<% End Using %>
And this is the submit method:
<HttpPost()> _
<ValidateInput(False)> _
Public Function UsrCtlSystemSetup(ByVal btnSubmit As String, ByVal model As SystemSetupViewModel) As ActionResult
model.SaveChanges()
Return PartialView("UsrCtlSystemSetup", model)
End Function
The problem I have is what should be returned from this method. Returning a partialView just returns a partialview which takes up the entire page. I need to be able to somehow just return the partial view back into the holding jquery tab. Is this possible? I could do a RedirectToAction back to the parent page action, but this would mean if there is errors in the partialviews model that is being submitted i wont be able to show it. Hope this makes sense.
Thanks in advance