Mvc 3 ajax redirect instead of updating div

Posted by / 06-Dec-2016 02:16

I’m using MVC 3 RC1, although this issue and solution should be applicable to future versions of MVC also.My goal was to setup an AJAX Action Link that makes an AJAX call and updates a Div on the page.I have read that this may be because Ajax is not enabled.

My problem is - when there is no more records for the propertied of teh vuew Model Group Menu returned from this partial view I want to redirect the user to new controller 'Product' and it's index action.

Here is my controller: I was dealing with same problem couple of days back, I just wanted to add to above answers and is by using AJAX.

you need to have two java scripts running in the main view page where you want to render other partial views. use Inline) use Inline = $(this).data("inline") if use Inline == "True" or use Inline == true if(! target Selector Prefix) target Selector Prefix = "#" $(target Selector Prefix target)url, callback else window.= url return false @Html.

OR a similar block using ajax to catch the click event and try to populate the partial view into a div on my form that way.

All of these methods have populated data but it always redirects to .../PO/Display POItems/1 and shows only the partial view there.

mvc 3 ajax redirect instead of updating div-50mvc 3 ajax redirect instead of updating div-71mvc 3 ajax redirect instead of updating div-47

We'll implement a "Register" action method within the new RSVPController class that takes an id for a Dinner as an argument, retrieves the appropriate Dinner object, checks to see if the logged-in user is currently in the list of users who have registered for it, and if not adds an RSVP object for them: Notice above how we are returning a simple string as the output of the action method.

One thought on “mvc 3 ajax redirect instead of updating div”