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);
}
}
}