Using Q1 2009 of Telerik RadControls for ASP.NET AJAX. I recently upconverted a web application to VS 2010 Beta 2 format (and ASP.NET 4.0). While it was generally successful and the application runs, I am experiencing an error which seems very difficult to get around. Hoping to get some feedback to see if anyone else has encountered it and if so, how resolve - or should I abandon for now and revert back to VS 2008/ASP.NET 3.5?
What is happening is this: I have a ScriptManager (or RadScriptManager - same issue) on a Master Page. On "some" content pages, not all, I encounter the following Javascript error when posting back from any control:
| Line: 14816 Error: Object doesn't support this property or method |
Then, if I choose to debug, the error occurs at the last line of this code block (14816):
| },_removeDropDown:function(){ |
| var _3c=this.get_dropDownElement().parentNode; |
| _3c.parentNode.removeChild(_3c); |
| if(this._disposeChildElements&&typeof |
| (Sys.WebForms)!="undefined"){ |
| Sys.WebForms.PageRequestManager.getInstance()._destroyTree(_3c); |
Following some leads, I have been able to work around the error on some pages by declaring the ScriptManager "closer" to the page that uses it - basically, "hiding" or removing the ScriptManager on the MasterPage and replacing it with one on the content page. BTW, if you try to do this, you'll find that while you can easily add a ScriptManager programmatically, it's quite difficult to remove one, since it's resistant to Controls.Remove(), ControlsRemoveAt(), .Visible, etc. The solution which has worked for me is to place the ScriptManager in a ContentPlaceHolder on the Master Page, "blank" it out on the content page using an empty ContentPlaceHolder, then programmatically add a new ScriptManager in Page_Init. (Yes, a hack, I know.)
However, placing the ScriptManager on the content page only works for some of the pages! In addition, in more complex content pages with nested user controls (e.g. a UC with a RadGrid, which then also hosts a UC for the edit form), I can't determine where/when exactly to add the ScriptManager to satisfy all the controls; some of them can't find it and exception out.
I have tested this on a stripped down project which just 1 Master Page + 1 content page. If I place the ScriptManager on the Master Page, I get the error. If I wipe out the ScriptManager on the Master Page and then re-add it in Page_Init of the content page, it works fine without errors, and I get AJAX partial page postback functionality.
Lastly, I have tried using the Q3 2009 version (trial) and I get the same error.
Any advice appreciated! Thanks,
Allen