asp.net mvc 3 - MVC3 JQuery Tabs -
I am trying to create three tabs with 3 partial views. The main view that hosts the tab.
& lt; Script type = "text / javascript" & gt; $ (Function () {$ ("# tab"). Tab ();}); & Lt; / Script & gt; & Lt; Div id = "tab" style = "display: inline; float: heir" & gt; & Lt; Ul & gt; & Lt; Li & gt; @ Ajax.exeLink ("Tab name 1", "Action mathia 1", "controller name", new Ajax option {UpdateTargetId = "div1"}) & lt; / Li & gt; & Lt; Li & gt; @ Ajax.exeLink ("Tab name 2", "Action math 2", "controller name", new Ajax option {UpdateTargetId = "div2"}) & lt; / Li & gt; & Lt; Li & gt; @ AjaxActionLink ("Tab name 3", "Action method 3", "controller name", new Ajax option {UpdateTargetId = "div3"}) & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Div id = div1 & gt; & Lt; / Div & gt; & Lt; Div id = div2 & gt; & Lt; / Div & gt; & Lt; Div id = div3 & gt; & Lt; / Div & gt; I have created the next button in Tab 1 and Tab 2 and have placed the button in tab 3.
Please click on the code (next) to click on tab 1 from tab 2. And where does this code contain whether it is in main view or partial ideas?
Addressing a more specific question than your comment
HTML (standard markup) ): To open Tab 2 with a button click in tab 1:
& lt; Div id = "tabs" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; An ID = "Tab 1" href = "# Tab-1" & gt; One tab & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; An id = "tab2" href = "# tab2" & gt; Tab two & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; An id = "tab3" href = "# tab3" & gt; Tab three & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; Div id = "tabs-1 & gt; button type =" button "id =" GotoTab2 "> Next >> jQuery
$ (Function () {$ ("# tab"). (); $ ('# GotoTab2') Click (function () {$ ('# tab2').) ();});});
Comments
Post a Comment