Navigation Bar from database
- by KareemSaad
i had soulation .i want to make navigation bar with items i will select them as (category,Product,....) So i made stored to get them throught paramater will pass it,s value from query string
as.
ALTER Proc Navcategory
(
@Category_Id Int
)
As
Select Distinct Categories.Category,Categories.Category_Id
From Categories
Where Category_Id=@Category_Id
and i mentioned in cs
as
if (Request.QueryString["Category_Id"] != null)
{
Banar.ImageUrl = "Handlers/Banner.ashx?Category_Id=" + Request.QueryString["Category_Id"] + "";
using
(SqlConnection conn = Connection.GetConnection())
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Navcategory";
cmd.Parameters.Add(Parameter.NewInt("@Category_Id", Request.QueryString["Category_Id"]));
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
LblNavigaton.Visible = true;
LblNavigaton.Text = dr["Category"].ToString();
}
}
}
so the result will be ex.
Fridge (Category when querstring(category_Id))
4Door (Product when querystring (Product_Id))
But I want the result
fridge4Door.......