This article is designed to give you quick information to create dynamic mouse over dual tab menu.
This guidance is intended for ASP.Net web developers.
To create a consistent, easily managed navigation solution for site, you can use tab menu navigation. Tab menu navigation offers the following features:
It provides a consistent way for users to navigate site. As your site grows, and as you move pages around in the site, it can become difficult to manage all of the links. Tab menu navigation enables you to store URL to all of your pages in a central location called sitemap.
You can use a site map to describe the logical structure of your site. You can then manage page navigation by modifying the site map as pages are added or removed, instead of modifying hyperlinks in all of your Web pages.
This control displays an expandable menu that users can traverse to get to different pages in your site. A node that contains child nodes is expanded when the cursor hovers over the menu.
Work Scope in the Project
You can modify design of this control by changing CSS files and also can add n number of tabs and its sub menu by doing entry of tags in XML file.
Solution Identified and Provided:
This is a mouse over tabs menu. Move the mouse over designated links, and additional sub menu contents appear in a separate block. It as an inline two level menu. You can specify name of main tab and sum menu with respective link in XML file, plus whether the sub menu contents should disappear when the mouse rolls out of that area.
You can easily toggle between a two level tabs menu. For the later, the entire a second level is hidden, allowing you to use script simply as tab links.
For this tab controls you need to create user controls because it's a reusable controls. A user control follows the same structure as a Web form, except that such controls are derived from the System.Web.UI.UserControl class, and are stored in ASCX files. Like ASPX files, an ASCX file contains static HTML or XHTML markup, as well as markup defining web control and other user controls.
Steps for Implementation:
Step 1: Create home.aspx page and register tab control on page.
<%@ Register TagPrefix="uc1" TagName="ucTabStrip" Src="myTab.ascx" %>
Step 2: Add tag in home.aspx page.
<uc1:ucTabStrip id="tab1" runat="server" ></uc1:ucTabStrip>
Step 3: Add user control in solution and rename it to "myTab.ascx"
Step 4: Write below code in source part of myTab.ascx
<link href="tabStyle.css" rel="stylesheet" type="text/css" />
<table runat="server" id="table1" ></table>
Step 5: Add following files in solution.
Step 6: Write below function in myTab.ascx.cs and call it in page load.
function will fetch elements of main tabs and sub
tabs from xml and create the controls dynamically
int i = 0;
string id, pnId, value;
//datset object for retriving data in table from XML
ds = new DataSet();
//reading of xml file and converted it into dataset
//getting count of maintabs
//creating reference of n panel and cells for tabs
pn = new Panel[n];
tc = new HtmlTableCell[n];
tr = new HtmlTableRow();
//creating array for Panel ID
arrId = new String[n];
//creating n panels
for (int cc = 0; cc
< n; cc++)
= new Panel();
//iterate rows for creating tabs and sub tabs
foreach (DataRow r
arrId[i] = r.ToString();
id = r.ToString();
"panelonMouseOut('" + id + "','" + pnId + "',"
+ n + ")");
"panelonMouseOver('" + id+ "','"
+ pnId + "'," + n + ")");
a = new HtmlAnchor();
"btnMouseOut('" + id + "','" + pnId + "'," + n + ")");
"btnOnclick('" + id + "','" +pnId + "'," + n
a.InnerText = r.ToString();
//creating for subtabs
rr in ds.Tables.Rows)
a = new HtmlAnchor();
a.InnerText = rr.ToString();
a.HRef = rr.ToString();
i = i +
for (int m = 0; m
< arrId.Length; m++)
//add block of tabs in table
Is this the Work Around or Best Solution?
Can this solution be improved: Yes the code and be improved or instead of running the batch file we can execute all the processes using DOT NET coding.