The WebDataMenu ItemClick events are not working for me when they are registered dynamically. The events do work when set statically in the page markup.
This is motivated by an upgrade of a legacy application using UltraWebToolbar, which was working. I'm using version 2014.2 (I haven't tried 2015.1 yet).
Anyone else see this issue?
Thanks,
Seth
****************************
It can be demonstrated with a simple ASP.NET page:
CS section:
protected void Page_Load(object sender, EventArgs e) { WebDataMenu1.ItemClick += new Infragistics.Web.UI.NavigationControls.DataMenuItemEventHandler(Control_ButtonClicked); } public void Control_ButtonClicked(object sender, Infragistics.Web.UI.NavigationControls.DataMenuItemEventArgs be) { int i = 1; }
ASPX section:
<ig:WebDataMenu ID="WebDataMenu1" runat="server" EnableScrolling="false" AutoPostBackFlags-ItemClick="On"> <GroupSettings Orientation="Horizontal" /> <Items> <ig:DataMenuItem Text="Test"> </ig:DataMenuItem> <ig:DataMenuItem Text="1"> </ig:DataMenuItem> <ig:DataMenuItem Text="2"> </ig:DataMenuItem> <ig:DataMenuItem Text="3"> </ig:DataMenuItem> </Items> </ig:WebDataMenu>
Denis, thanks very much -- that solved this issue. Initializing the handler in the OnInit method allowed the WebDataMenu click handler to fire.
I've attached the working sample for posterity.
Hello Seth,
You can use OnInit event of the Page the in order the register the handler of the ItemClick event.
Let me know if you need further assistance.
Attached is a simple web application. Default.aspx uses a master page -- the callback is not triggered. Default2.aspx does not use a master page, and the callback is triggered. It uses version 2015.1 of the ASP.NET framework, with the service release.
Thanks for looking at this.
Could you please share the sample that you mentioned with me. I will be glad to help you by investigating it further for you.
Thanks for the reply.
It looks like the difference is the master page -- I can confirm that my example works with a scriptmanager on the form page and no master page.
However, when I try to use a master page with the scriptmanager in the master page, it doesn't work. I've tried with a scriptmanagerproxy on the child page, but I'm still not able to get it to work.
Do you have an example using a master page?
Thank you,