views:

103

answers:

1

I have an Ajax.Actionlink that fires to a method that is placed inside my controller which returns a list of users and renders a partial view.

[Authorize]
public ActionResult UsersAddresses()
{
     ...
     ...
     return PartialView("AddressesList",users);
}

Is there any way how I can render two or more partial views at the same time?

Thanks

A: 

If you're just trying to concatenate partial views together, make a partial view (we'll just call it Parent), then within that view call Html.RenderPartial() as many times as you need. Then your controller can just return a View / PartialView for Parent, supplying the proper aggregate view data.

Levi
Thanks Levi, but I'm trying to render Partial Views that are on different scopes. For example, let's supposse that we would write our answers of stackoverflow on a popup (partial view) and there would be a counter on the back of the page being updated with the number of answers.
cer
So the particular scenario is that you're doing this from an AJAX call and want to update multiple DIVs? Currently there's no facility for pulling this off. But if you include a dummy DIV as part of the response, you can probably check for this as part of the hookup event, then just move the contents of that DIV elsewhere.
Levi