I am trying to organize work with bookmarks (tab):

enter image description here

Schools.cshtml

... <div> <ul class="nav nav-tabs"> <li id="tab_info"><a href="#">Реквизиты</a></li> <li id="tab_rmschool"><a href="#">Отчеты</a></li> </ul> </div> <script type="text/javascript"> $(document).ready(function () { $('#School').change(function () { var schoolid = $("#ddlSchool").val(); $.ajax({ url: "/Report/GetRMschoolPV?_schoolID=" + schoolid, type: "GET", data: "@User.Identity.Name",//если в Razor success: function (data) { $("#tab_rmschool").html(data) } }) }); }); </script> 

But after the changes to the School this is what happens:

enter image description here

url: "/Report/GetRMschoolPV?_schoolID=" + schoolid returns a частичное представление .

As a result, as seen in the screenshot: a partial view is loaded into the tab_rmschool block. But this very block I still blocked the tab with its name "Reports".

  1. What am I doing wrong?
  2. Maybe there is some kind of template? After all, it seems to me that such functionality is used often.
  • 2
    What is the problem then? inserted in the wrong place? - Buka
  • @Buka is inserted there, but this insertion overlaps the name of this tab for me - Отчеты . - Adam
  • one
    why don't you create a block in which you will insert the result of the query ( <div id="tabContent"></div> ) which will be located below the tabs - Bald
  • This is called "what they asked for, they received." Find another block that you will “overlap” if you don’t like the reports ... - Pavel Mayorov
  • @PavelMayorov yes indeed). Thanks @Buka! I would also like to note that answering your 2 question, jQuery UI turned out to be a handy Tabs widget for this purpose. - Adam

1 answer 1

Just create another div under the ones you don't want to hide and upload your code into this div .