Usermenu.ascx
This is the AvailableCategories section that you see on the
left side of the login screen.I have used a datalist control with hyperlink in
the item template sections.The hyperlink is databound to columns in the SQL
query.It displays all the categories.When u click on any of the category it
takes u to another page which displays all the related sbcategories placed
under that selected category.
private void
Page_Load(object sender, System.EventArgs e)
{
// Write the
code in page load so that when the page loads the categories must be shown.
String
selectionid = Request.Params["selection"];//
Get the selection id from the post page
if(selectionid != null)
{
mylist.SelectedIndex
= Int32.Parse(selectionid);
}
// Instantiate an object of class ProductsDB to call the
getproductcategories method.
prjstart.ProductsDB
getcategories = new ProductsDB();
mylist.DataSource=getcategories.GetProductCategories();
mylist.DataBind();
}