forum

Home / DeveloperSection / Forums / Add title to links of this menu in c#

Add title to links of this menu in c#

Tom Cruser 1766 28-Oct-2014
How can I add title to all links of menu that create with this code on c# ?
and the title I need is menu name and can I add h2 property to all link? if your answer is yes 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);

c# c#  .net  asp.net 
Updated on 28-Oct-2014

Can you answer this question?


Answer

1 Answers

Liked By