foreach (DataRow drItems in dsRoles.Tables[0].Rows)
{
MenuItem smsParentItem = new MenuItem((string)drItems["menuName"]);
if (drItems["parentID"].ToString().Equals("0"))
{
SMSMenu.Items.Add(smsParentItem);
smsParentItem.Value = drItems["menuUID"].ToString();
}
}
for (int i = 0; i < SMSMenu.Items.Count; i++)
{
foreach (DataRow drItems in dsRoles.Tables[0].Rows)
{
if (SMSMenu.Items[i].Value == drItems["parentID"].ToString())
{
MenuItem smsChildItem = new MenuItem((string)drItems["menuName"]);
SMSMenu.Items[i].ChildItems.Add(smsChildItem);
smsChildItem.NavigateUrl = drItems["menuURL"].ToString();
smsChildItem.ImageUrl = ""
}
}
}
SMSMenu.Orientation = Orientation.Vertical;
SMSMenu.DataBind();
No comments:
Post a Comment