0

Hi

I have a partial view, where my partial view will be called from Menu. When i call it, do server send only the partial view, or send all view (header, menus, footer)?

2
Contributors
3
Replies
18
Views
3 Years
Discussion Span
Last Post by pitic
1

It realy depends on how you call your action. If it's a normal http get request it loads the layout + view + every partial.
If you want only the partial view to be retunred do an ajax call and replace the content with the result.

0

Actually, i want to select one to reduce bandwith consuming, either ajax or normal way.
I thought the server only returned the partial view, as there are 2 options when creating view, partial and using master page. As you told, normal http get request it loads all, so partial view is just for modularity.

thanks

0

Yep. If you worked with ASP.NET Webforms, partial views are the same as ascx files. They get loaded into the layout view (or master page in webforms).
If you want to save bandwith then go for ajax + partial view and replace the <div> (or whatever) on the master view (which is already loaded) with the new content

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.