- Home
- Forum
- ASP.NET Web Forms (Classic)
- Problems with the Menu Control
Problems with the Menu Control
I'm adding menu items dynamically in the Page_Load event of a user control.
string url = String.Format("~/Nymex/Details.aspx?nhid={0}", ext.NhId);
MenuItem menuItem = new MenuItem();
menuItem.Text = ext.NhSessiondate.ToString("MMM dd, yyyy (ddd)");
menuItem.NavigateUrl = url;
menuItem.ID = ext.NhId.ToString();
item.Items.Add(menuItem);
When I click on the menu item it just does a postback to whatever page it's on and doesn't go to the NaviageUrl. This worked using the asp:menu control.
All of my other menu items that are defined in the ascx page work fine. I'm only having problems with the ones I add dynamically.
string url = String.Format("~/Nymex/Details.aspx?nhid={0}", ext.NhId);
MenuItem menuItem = new MenuItem();
menuItem.Text = ext.NhSessiondate.ToString("MMM dd, yyyy (ddd)");
menuItem.NavigateUrl = url;
menuItem.ID = ext.NhId.ToString();
item.Items.Add(menuItem);
When I click on the menu item it just does a postback to whatever page it's on and doesn't go to the NaviageUrl. This worked using the asp:menu control.
All of my other menu items that are defined in the ascx page work fine. I'm only having problems with the ones I add dynamically.
SIGN IN To post a reply.
3 Replies
MP
Martin Phee
June 27, 2007 07:10 PM UTC
I moved the code to populate the menu items to Page_Init and now it seems to work. This is different than how the asp:menu control works and a little unexpected.
Shouldn't it work in the Page_Load?
Shouldn't it work in the Page_Load?
RR
Ramya R
Syncfusion Team
June 28, 2007 07:10 AM UTC
Hi Marty,
Thank you for your interest in Syncfusion Products.
I was not able to reproduce the issue that you have mentioned here.
Could you please take a look at the attached sample and modify it to reproduce the issue that you have mentioned here and send it back to us, so that it would help us in analyzing this issue?
You can download the sample from the below provided webpage link,
http://websamples.syncfusion.com/samples/Tools.Web/5.1.0.51/F63072/main.htm
Please let me know if you have any queries.
Thanks & Regards,
Ramya.
Thank you for your interest in Syncfusion Products.
I was not able to reproduce the issue that you have mentioned here.
Could you please take a look at the attached sample and modify it to reproduce the issue that you have mentioned here and send it back to us, so that it would help us in analyzing this issue?
You can download the sample from the below provided webpage link,
http://websamples.syncfusion.com/samples/Tools.Web/5.1.0.51/F63072/main.htm
Please let me know if you have any queries.
Thanks & Regards,
Ramya.
DD
Dharmesh Desai
October 17, 2007 01:40 PM UTC
Hi Ramya,
I have experienced a similar problem with the menu control. In my case I had the menu.NavigateUrl = "page.aspx" and it would not work, so I fixed this by using the Target property, which then fixed the issue.
Is there a bug in the control?
Thanks,
Dharmesh Desai
>Hi Marty,
Thank you for your interest in Syncfusion Products.
I was not able to reproduce the issue that you have mentioned here.
Could you please take a look at the attached sample and modify it to reproduce the issue that you have mentioned here and send it back to us, so that it would help us in analyzing this issue?
You can download the sample from the below provided webpage link,
http://websamples.syncfusion.com/samples/Tools.Web/5.1.0.51/F63072/main.htm
Please let me know if you have any queries.
Thanks & Regards,
Ramya.
I have experienced a similar problem with the menu control. In my case I had the menu.NavigateUrl = "page.aspx" and it would not work, so I fixed this by using the Target property, which then fixed the issue.
Is there a bug in the control?
Thanks,
Dharmesh Desai
>Hi Marty,
Thank you for your interest in Syncfusion Products.
I was not able to reproduce the issue that you have mentioned here.
Could you please take a look at the attached sample and modify it to reproduce the issue that you have mentioned here and send it back to us, so that it would help us in analyzing this issue?
You can download the sample from the below provided webpage link,
http://websamples.syncfusion.com/samples/Tools.Web/5.1.0.51/F63072/main.htm
Please let me know if you have any queries.
Thanks & Regards,
Ramya.
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
MP Martin Phee
- Jun 27, 2007 06:33 PM UTC
- Oct 17, 2007 01:40 PM UTC