2
votes

I am using Ajax.BeginForm in ASP.NET MVC to post a form. I have one div being updated using AjaxOption's UpdateTargetId property. Now I need the post to update 2 Divs. I also need to return 2 different views.

Here is the code that I have presently:

<%using(Ajax.BeginForm("Create", new { controller = "View"},new AjaxOptions { UpdateTargetId = "view_tabs" })){ %>
<%= Html.TextBox("viewName") %>
<input type="submit"  value="Create a New View"  /><br />
<%} %>

Or maybe, the form's submit action should post to one controller returning a view and also make a get request to another controller that returns another view?!!

How do I achieve this using the MVC framework? I don't want to use JQuery or other Javascript libs.

1

1 Answers

1
votes

I don't want to use JQuery or other Javascript libs.

Do you have an issue qith jQuery? Because it really is an amazingly great framework. To the best of my knowledge the ASP.NET MVC AJAX is quite limited in it's capabilities, but you can possibly directly use the ASP.NET AJAX libraries?

I do suggest giving jQuery a chance though.