Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created dynamic website , and also i have created dynamic menu with submenu using MENU NAVIGATION of asp.net , but when we create submenu of a menu , like in service if i create servcice1, service2 and service3 then how i add content template to each service page...

Please reply me soon.


i have created submenu using this code , please povide me code for Adding a Content Template to Dynamically Created Menu Item.

What I have tried:

 protected void Button1_Click(object sender, EventArgs e)
    {
        using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
        using (SqlCommand cmm = new SqlCommand())
        {
            cmm.Connection = cnn;
            cmm.CommandType = CommandType.Text;

            cmm.CommandText = "INSERT INTO [createmenu]([MenuId],[ParentMenuId],[Title],[Description],[Url])" + "VALUES(@MenuId,@ParentMenuId,@Title,@Description,@Url)";
            cmm.Parameters.AddWithValue("@MenuId", TextBox2.Text.Trim().ToString());
            cmm.Parameters.AddWithValue("@ParentMenuId", TextBox1.Text.Trim().ToString());
            cmm.Parameters.AddWithValue("@Title", TextBox3.Text.Trim().ToString());
            cmm.Parameters.AddWithValue("@Description", TextBox4.Text.Trim().ToString());
            cmm.Parameters.AddWithValue("@Url", "~/Website/" + TextBox5.Text.Trim().ToString() + ".aspx");


            cmm.Connection.Open();
            cmm.ExecuteNonQuery();
            cmm.Connection.Close();
            ScriptManager.RegisterStartupScript(this, GetType(), "Success", "alert('Information Saved.');", true);

        }
    }
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900