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.
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 File PartialViewMenu.vbhtml 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
& 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;
& 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;
$ (function () {$ ('# link1') (function () {$ .ajax ({url: this.href, datedType: "script", success: Function (results) {$ ("# Container") HTML (Result);}}}};}); e.preventDefault (); return false;}); });
Comments
Post a Comment