» Forums
» DynarchMenu forum
» Support
» Lose viewstate when in menu
Lose viewstate when in menu
2005/06/18 03:07
Viewed 4483 times
Replies: 1/3
Ok, this is getting to be quite frusterating as it has taken me a while to narrow this problem down. Here is the situation: I am using asp.net and I have a dynarchmenu item with a div tag that contains a textbox, dropdownlist and a linkbutton. When you click the linkbutton its onclick handler needs to get the info from the textbox and dropdownlist. This works perfectly well when remove the onload='DynarchMenu.setup("menu");' from the body tag. Problem: When I have it load as a menu the linkbutton submits just fine but the viewstate is lost for the items in the menu. For now I am ignoring the dropdown list and just focusing on getting the content of the textbox to be posted. In javascript console I am also getting an error when i put my cursor over the textbox (only when it is in the menu) Here is that error (not sure if this has anything to do with it as this error is not generated for the dropdownlist: Error: uncaught exception: Permission denied to get property HTMLDivElement.parentNode Right now for testing I have the system in an ascx file and I have 2 copies then loaded into the page, one is loading the menu and the other one just stays a list. The list continues to work as expected but the menu again does not. The list maintains its viewstate when i click the link button from either menu. I have tried switching the textbox to an htmlinput with the runat="server" along with several other variations. Any help would be greatly appreciated. I can post code if necessary but I don't think it is at the moment. Thanks in advance
Re: Lose viewstate when in menu
2005/06/25 21:58
Viewed 6147 times
Replies: 1/2

It seems the above mentioned problem is a lot simpler then it seems.  After further searching it seems that when the menu is written to the dom it is written at the bottom of the page.  This causes a problem when using asp.net as it is then written outside of the form tag and then not handled by asp.net. 

Mihai, I was wondering if there could be a way to specify an argument in the DynarchMenu.setup function to have the menu written within a specific element.  For me that would be the form.  This way I could place standard asp.net controls within the menu and use them without any other customization. 

So basically all I am asking is that the menu would append to a given element instead of only appending to the body. 

Thanks in advance,
Kaisun

last
Re[2]: Lose viewstate when in menu
2005/06/25 22:02
Viewed 7827 times
Replies: 1/1

That's not easy to do with the current version, but it should be trivial to implement. However, I doubt that the menu will still work correctly if all elements are under the parent of your choice—that's because the “absolute” position in CSS is actually relative to the closest parent with “position: relative”.

Anyway, if that's a feature you would need in order to become our client, then consider it already on our TODO list. :-)

last
Google