vb.net - Update a partial view from another partial view in ASP.NET MVC without updating all the views -


I have two partial views, for the left one, the menu, and the right one, the content.

Enter image details here

When I click "Link 1 "I want to switch the" content "field from partial view" PartialViewContent1 "to" PartialViewContent1 "

In terms of code, I actually manage to do this.

File index. Vbhtml

  & lt; body & gt; & Lt; Articles & gt; & Lt; Section & gt; & Lt; P & gt; @ Html.Action ("Menu", "Menu") & lt; / P & gt; & Lt; / Section & gt; & Lt; / Article & gt; & Lt; On one hand & gt; Episode "Menu3" @ Html.Action ("PartialViewContent3", "PartialViewContent3") Episode @ Html.Action ("PartialViewContent2" "Partial View Content 1", "Partial View Content 1") Select End & lt; / Aside & gt;   

File PartialViewMenu.vbhtml

  & lt; Ul & gt; & Lt; Li & gt; @html.exe link ("link 1", "link 1", "home") & lt; / li & gt; & Lt; Li & gt; @html.exe link ("link 2", "link 2", "home") & lt; / li & gt; & Lt; Li & gt; @html.exelink ("link3", "link3", "home") & lt; / li & gt;   

This architecture, every scene (and partial visual display) is fresh.

I am afraid that this behavior is not ergonomic and not very efficient in performance, there is no way to update the contents and there is no menu (or else the footage if any footer Or header)?

How do I finally do it?

Ajax is a simple jQuery code Works. Click on

  $ (function () {$ ('# link1') (function () {$ .ajax ({url: this.href, datedType: "script", success: Function (results) {$ ("# Container") HTML (Result);}}}};}); e.preventDefault (); return false;}); });    

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

sql server ce - Is there some way to make sqlce3.5 and 4.0 co-exist in the C# project -