Hi,
i tried nearly everything but i dont find the way how to avoid postbacks on a click on unlinked menu items or parent items.
I will describe it on an example to make it clear. Look at this menustrukture:
Options
If the user press "Options" or "More" there should be no postback because their is no tag, no url and nothing else defined. So the page will reload and it will happen nothing.
How is it possible to disable this behavior? I tried to step though the show cases but i was not able to find the tag or trick to do so.
Thank you very much
Holger
Hello,
Thanks for writing. I am not sure you can disable postback event at all in the postback event handler, since the postback has already happened (this is way the postback event handler was called in the first place).
Is the solution with javascript suggested above applicable in your case? If not, could you please tell us a little bit more information about your setup - this will surely provide additional clues.
I need to disable the postback on the code behind. When the user selects a top level node, I want nothing to happen. How would I go about doing that. I have the following code but nothing in the event args gives me access to deny postback:
Dim newItem As Infragistics.WebUI.UltraWebNavigator.Item
cookieCols = Request.Cookies
Select Case e.Item.Text
Case Is = "Logout"
Dim e1 As New CommandEventArgs("", System.DBNull.Value)
End Select
Case Is = "Reports" ?
yes i will try this. I really thing infragistics is the best out there. The only big issue is to find the information you are looking for. There are tons of forums, devcenters, howtos and examples.. But hell, the easiest way is to google and it looks like the pages are not parsed that good.. You mostly get results from other newsgroups or spamed forums...
But anyways.. I think a AllowPostback Property of menu items would rock.. ;P
ty, Holger
Cool - looks great. I totally forgot to check out the DevCenter - it really has a lot of hidden gems that match a lot of common scenarios.
Thanks for sharing the solution in forums - this will surely be helpful for other developers.
Thank you! Though your hint i found another how to that matches the problem.. It checks if a menu entry has a child and aborts the postback if a child has been found.
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=8625
function itemClickHandler(menuID, itemID) { var item = igmenu_getItemById(itemID); var menu = igmenu_getMenuById(menuID); var child = item.getFirstChild(); if (child != null) { menu.NeedPostBack = false; menu.CancelPostBack = true; } else { menu.NeedPostBack = true; menu.CancelPostBack = false; } }