I just learned that ignav:item's cannot have a "ID" property (why?).In the provided online samples I saw you used a switch case with e.Item.Text - this is not an option in our application (it is localized and so I don't know the current text to switch). We also cannot use the index, because the items vary with the LoginView templates.
So how can we detect the clicked item in the postback processing of the click event?
Hello Torsten,
You can try usiung the "Tag" property. Since it is of type Object, you can set it any value (preferably unique), so you can easily check/switch it in the event handler, like this:
protected void UltraWebMenu1_MenuItemClicked(object sender, Infragistics.WebUI.UltraWebNavigator.WebMenuItemEventArgs e) { int clickedTag = int.Parse(e.Item.Tag.ToString()); switch(clickedTag) { ///Put your logic here. } }
Hope this helps!
Yes, that helps (a bit). Although I need to know: how does the "Tag" flow through the client/server request/response? Is it a viewstate thing? Then we need to activate viewstate handling for that control/page. How is it done, if viewstate is off?
Is "Tag" the same thing as "TagString" (except the type)? Where is "TagString" stored (again: viewstate or not)?
Hi Again,
It will work for you if you do not enable viewstate.With complete viewstate turned off on page level, you will still get the accurate Tag value when hooking the server side event MenuItemClicked.