Click here to Skip to main content
15,881,882 members

Comments by KUNWAR999 (Top 4 by date)

KUNWAR999 3-Apr-12 14:39pm View    
here is the code..
protected void Page_Load(object sender, EventArgs e)
{
DataSet dst = dm.getcategories();
Menu1.Items.Clear();
foreach (DataRow masterRow in dst.Tables["category"].Rows)
{
MenuItem masterItem = new MenuItem((string)masterRow["category"]);
masterItem.Value=masterRow["ID"].ToString();
Menu1.Items.Add(masterItem);
foreach (DataRow childRow in masterRow.GetChildRows("Children"))
{
MenuItem childItem = new MenuItem((string)childRow["subcategory"]);
childItem.NavigateUrl = "Page2.aspx";
Session["category"] = Convert.ToInt32(masterRow["ID"]);
Session["subcategory"] = Convert.ToInt32(childRow["CID"]);
masterItem.ChildItems.Add(childItem);
}
}
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MenuItem m = Menu1.SelectedItem;
Session["id"] = Convert.ToInt32(Menu1.SelectedValue);//it takes level1 node of menu,i need 2nd level menu id,, subcategory of category as u can see in code now..
Response.Redirect("Page2.aspx");

}
KUNWAR999 1-Apr-12 5:17am View    
i want to make it run faster in parllel code than sequential code.. do you know how can i do that.. ??
KUNWAR999 31-Mar-12 7:08am View    
i used i++; inplace of Console.WriteLine(i);
it gives 312 microseconds for sequential code and 2361 microseconds for parllel code..
KUNWAR999 31-Mar-12 6:13am View    
if i use some other statement instead of Console.WriteLine(i.. then it again shows same problem.. :(