Monday, March 26, 2012

Probblem with Menu control inside an update panel

Hi,

I have a master page with a script manager ,update panel and Content Palce Holder. in the default page which uses the masterpage I have added a menu control, textbox and a button. I have two problems which I have seen in the past in other versions of ajax. I have not coded anything other than just these controls on a page

1) I could click on button all day long and there is no java script error but as soon as I click on a menu item I get javascript error saying:

Line:221

Char:20

Error '0.cells' is null or not an object

code: 0

2) I can not get my CSS sheet work in my app theme for the background images. I have the following code in my CSS

.Menu1BackGround

{

background-image:url(/Images/Menu1_Background.bmp);

}

and I have assigned the it to the menu. Nothing happens as if it does not recognize the image path. I could add the background:black to the code and it works fine for the color but not the image. I am not sure if thisis because of the same problem.

Any body have any ideas?

Thanks

Seehttp://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx#UpdatePanelCompatibleControls. The Menu control is not supported inside an UpdatePanel.

I have 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. 

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

HTH


Menu control is not compatable with AJAX.

I m also facing sme problem..

No comments:

Post a Comment