Wednesday, March 21, 2012

Use a menu control in updatepanel

that occurs a javascript error when click another tab: "0.cells" is null or not an object.

who can help me? thanks.

The menu control is not compatible with partial-page updates and can't be used inside a UpdatePanel.


what can i do if i want to implement this function?thx.
Could you run this in JS debugger and post a snippet of affected JS.. I vaguely remember dealing with this issue and it might allow us to see what is exactly happening

did quick google

and found e.g. this

http://forums.asp.net/thread/1485169.aspx


thanks for your information, i read a blog and using this method it works well.

http://mcosier.blogspot.com/2006/12/0cells-is-null-or-not-object-aspnet-20.html

but i have a problem that:

it seems that using AsyncPostBackTrigger can't change the StaticSelectedStyle after i clicked another menuitem?

thanks.


I've been using this piece of javascript to go around the menu problem:

var oldMenu_HideItems = Menu_HideItems;if(oldMenu_HideItems){Menu_HideItems = function(items){if (!items || ((typeof(items.tagName) =="undefined") && (items instanceof Event))) { items = __rootMenuItem; }if(items && items.rows && items.rows.length == 0){ items.insertRow(0); }return oldMenu_HideItems(items);} }
I got it from the asp:menu javascript code and I hook it to "patch" the problem.
Adding it to a page where a menu resides makes the javascript error go away. 

This one works great for me.

Thank you very very much.Big Smile

Great


it is working.. Smile Thank you for your great solutions.

thanks t0yBig Smile

i tryed it.and i dident give that error.

thanks again.


Dear sir

can you please tell me where to put this code in what event, name of the function it is very imp.

thank you,

please advise what to do.


This piece of Javascript has saved me hours of googling! Awesome work buddy and thanks heaps!

See for more info , which controls are not compatable with UpdatePanel

http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx


I cannot figure out how to use this fix. I put this script in my page and I'm still getting the 0.cells is nothing error.

How do I hook this up?

Thanks!


Have you tried the solution thatt0y provided..

It's working..Smile

No comments:

Post a Comment