Hi all,
I am really puzzled about the Atlas UpdatePanel control not working on a MCMS template page. Can someone please comment on possible fixes, issues related to using this control of MCMS? I am not very familiar with how the control work under the hood. Can someone pinpoint me where to find documentation on the internal workings of this control?
Here is what I have tried so far.
I followed the insertion of the javascript on the page_load event handler post on this linkhttp://blogs.technet.com/stefan_gossner/archive/2006/06/01/431687.aspx?CommentPosted=true#commentmessage
// register a client script that ensures that the action property
// is correct when AJAX tries to do its postback.
string script =
"\n<script type=\"text/javascript\">\n" +
" if (typeof (__CMS_CurrentUrl) != \"undefined\")\n" +
" {\n" +
" __CMS_PostbackForm.action = __CMS_CurrentUrl;\n" +
" }\n" +
"</script>\n";
Page.ClientScript.RegisterStartupScript(this.GetType(), "AdjustActionForAJAX", script);
However, no luck at all.
Here is a description of the behaviour after that Javascript insertion.
I try using the ATLAS:UpdatePanel control and it didn't work. The button on my page and the clicked results are wrapped inside the content of the UpdatePanel. In view mode, it still does a postback by refreshing the page. And in author mode, there are more problems. The edit link for the web author console will not show up when it is clicked.
Have anyone tried using the ATLAS:UpdatePanel control with a MCMS site.
The only post I found ishttp://forums.asp.net/thread/1335638.aspx
The person responded the following:
It was a painful lesson, but I was able to see multiple things that CMS did to break ATLAS.
- CMS writes a JScript block intercepts the ATLAS async post sent from the client and throws it on the floor. So, the client never gets the post back off the machine. Turns out using the DefaultConsole control is writing the additional JScript block. Needed for CMS editing of the page.
- When using the cms:RobotMetaTag control in CMS, it will cause the XMLDOM load to fail for ATLAS on the postback because of the '&' characters in a <BASE> tag. Plus there is a <META> with no closing tag. This control can be removed if you don't want to use the CMS feature.
We resorted to placing the ATLAS enabled page in an iFrame of a page that was done in CMS. Seems to work
This is still an issues with 1.0 RC.
Has anyone else been able to get the UpdatePanel to work with MCMS?
Here is what I finally came up with to adjust for the ugly CMS urls that was causing AJAX to reject the post backs from UpdatePanel. This is currently going through test, and I'm not sure if it broken FireFox, but this is what I have to get it work in IE.
// add this Script to handle the confusing between CMS and AJAX
string script = "\n<script type=\"text/javascript\">\n" +
"Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);\n" +
"function EndRequestHandler(sender, args) { \n" +
" if (typeof (__CMS_CurrentUrl) != \"undefined\")\n" +
" {\n" +
" Sys.WebForms.PageRequestManager._instance._form._initialAction = __CMS_CurrentUrl;\n" +
" }\n" +
"}\n" +
"EndRequestHandler(null, null);\n" +
"</script>\n";
Page.ClientScript.RegisterStartupScript(this.GetType(), "AdjustAJAXForCMS", script);
I figured out that this fix is for IE and is not needed for FireFox. Funny how the two browsers deal with this.
So I added a check for IE before I write the script block.
Does anyone have an update on this issue? I'm having the same problem and I was able to narrow it down to the RobotMetaTag object and the BASE tag that it appends.
Any help is appreciated.
Thanks,
Ahmed
No comments:
Post a Comment