---
title: "Add title to links of this menu in c#"  
description: "Add title to links of this menu in c#"  
author: "Tom Cruser"  
published: 2014-10-28  
updated: 2014-10-28  
canonical: https://www.mindstick.com/forum/2448/add-title-to-links-of-this-menu-in-c-sharp  
category: "c#"  
tags: ["c#", ".net", "asp.net"]  
reading_time: 2 minutes  

---

# Add title to links of this menu in c#

How can I [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) [title](https://www.mindstick.com/articles/12860/how-to-get-financing-for-salvage-title-cars) to all [links](https://www.mindstick.com/blog/415/css3-links) of menu that create with this [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) on c# ?and the title I need is menu [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) and can I add h2 [property](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) to all [link](https://www.mindstick.com/articles/23633/link-builder)? [if your](https://www.mindstick.com/forum/156103/what-will-be-your-approach-if-your-seo-method-doesn-t-work) answer is [yes](https://www.mindstick.com/forum/157763/how-to-return-yes-no-based-on-date-comparison-in-sql) so please help me to do this. \

```
DataTable table = new DataTable();        string strCon = System.Configuration.ConfigurationManager.ConnectionStrings["awdbCS"].ConnectionString;        SqlConnection conn = new SqlConnection(strCon);        string sql = "select menu_id, menu_name, menu_parent_id, menu_url from menuMaster order by place";        SqlCommand cmd = new SqlCommand(sql, conn);        SqlDataAdapter da = new SqlDataAdapter(cmd);        da.Fill(table);        DataView view = new DataView(table);        view.RowFilter = "menu_parent_id = 0 ";        foreach (DataRowView row in view)        {            MenuItem menuItem = new MenuItem(row["menu_name"].ToString(), row["menu_id"].ToString());            menuItem.NavigateUrl = row["menu_url"].ToString();            menuBar.Items.Add(menuItem);            AddChildItems(table, menuItem);
```

## Replies

### Reply by Anonymous User

Instead of passing first argument to MenuItem constructor as name of the menu you can pass as below to apply h2 header for it.\

```
MenuItem menuItem = new MenuItem("<h2>" + row["menu_name"].ToString() + "</h2>", row["menu_id"].ToString());
```

\
This will display it as h2 header.\
\
Not sure what do you mean by title here, as if you do as above it will display menu name as display text and id as value for it.If you mean by html tip to view on its hover then \
\

```
menuItem.ToolTip = "TitleText";
```


---

Original Source: https://www.mindstick.com/forum/2448/add-title-to-links-of-this-menu-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
