I'm working on a project with Visual Studio 2010 ASP.Net MVC4 (engine view Razor) and need to make a tabs. I define this scrips and css:
<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.min.js")" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#tabs").tabs();
});
</script>
It also defines the format html for the tabs:
<div id="tabs"> .....
but when excecute don't showme the tabs, how I can solve this problem. only showme format html, this:
Index
Tab Header 1
Tab Header 2
Tab Header 3
Content for Tab 1 goes here.
Content for Tab 2 goes here.
Content for Tab 3 goes here.
Just to add Bootstrap 3.x solution. I encountered a problem using class="tab-pane fade active" id="tab_1", the entries in tab_1 will not display upon page load.
Instead, I removed fade in the tab_1 (see below)
or replace it with class="tab-pane fade active in"
It worked for me.
Bootstrap 3.x solution:
Here is a jsfiddle for Jquery Tabs.
Step 1: Import
Step 2: Html Code
In the ‘li’ tags you need to define the tab header and for each tab header a tab content div exists, the code below is pretty self explanatory.
Step 3: Final Touch – Jquery call to tabs()
Output:
Source
If you work with ASP.net MVC4 then config _Layout.cshtml add this lines into Head html
and delete from body (html) this line
and execute the program and show the tabs