Last post Feb 26, 2014 09:08 AM by jstranger
Feb 20, 2014 01:12 PM|jstranger|LINK
I have an intermittent problem that I think is related to use of the Ajax Control Toolkit. Incidentally this is a non-public website running on ASP.NET 4.0 which is only required to support IE10+ browsers.
I have a fairly simple page containing one GridView linked to an ObjectDataSource with Select and FilterParameters. There is also an ImageButton with an ID of AddButton with an attached ModalPopupExtender as follows:
<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server" TargetControlID="AddButton" PopupControlID="AddPanel" BackgroundCssClass="modalBackground" DropShadow="true"
<asp:Panel ID="AddPanel" runat="server" style="display:none" >
<iframe id="AddFrame" runat="server" width="717" height="370" style="background:transparent;border:none;margin:0;padding:0;" />
<asp:Button ID="CloseButton" ClientIDMode="Static" runat="server"/>
<asp:Button ID="CancelButton" ClientIDMode="Static" runat="server"/>
I set the src of the iframe in code behind on Page.Load as follows (the url can only be determined programmatically):
If Not IsPostBack Then
If Roles.IsUserInRole("Editor") Then
AddFrame.Attributes("src") = "addpol.aspx?id=" & .....
AddButton.Visible = True
AddButton.Visible = False
for a filter, paging on the GridView or even a simple link to a separate page. But 9 times out of 10 (not a precise measure!) there is no error and everything is fine. The error has not so far occurred when the initialisation code on Page.Load is not run,
I am several versions behind the latest version of the Toolkit (I have so far tested with the January 2013 release 7.0123 and the June 2013 release 7.0607), but I have not found any reported workitems which appear to relate to my problem so am reluctant
to upgrade to a newer version unless I am confident that this is a known issue that has been resolved. Has anyone else experienced anything similar or have any suggestions as to how best to investigate such an issue? Is there a better way/place/time to initialise
the iframe or otherwise ensure that all dependencies are fully loaded?
Feb 21, 2014 03:13 AM|Happy Chen - MSFT|LINK
Sorry , i don't reproduce your issue again.
you also can check out the links :
Hope it helps you.
Feb 21, 2014 04:15 AM|jstranger|LINK
Feb 21, 2014 04:18 AM|jstranger|LINK
And apart from the ModalPopupExtender the parent page is otherwise extremely simple - there is no ValidationSummary and no use of UpdatePanel. Just an ObjectDataSource a couple of TextBox and DropDownList controls and a GridView.
Feb 24, 2014 05:52 AM|Happy Chen - MSFT|LINK
Could you provide a simple demo which is related to this issue? It may be a bit easier to resolve if it can be easily reproduced.
Thank you for your understanding.
Feb 24, 2014 10:59 AM|jstranger|LINK
Thanks for the reply. Since my last post I was in fact working on trying to discover the simplest page that would reproduce the error. As a starting point I made a copy of the failing page and ran that within the same website/project/solution - and I have
not been able to get it to fail! Same code, same master page, same stylesheet, same bin folder (including the Ajax Control Toolkit). In both cases running from VS 2012 Express in debug mode using IIS Express on the same Windows 7 PC. But if I run the original
pages. So currently I cannot provide a simple demo that will reproduce the error. And I am out of ideas other than to recreate the failing pages and hop for the best.
Feb 25, 2014 03:48 AM|Happy Chen - MSFT|LINK
if so , you can update the last version of AjaxControlToolKit:
PM> Install-package AjaxControlToolKit
then recreate the project and rebuild the project.
I hope you can succeed as far as soon.
Feb 25, 2014 05:03 AM|jstranger|LINK
I really do not want to update to a later version of the Toolkit right now unless I really have to - there have been far too many reported bugs and problems with the last few releases.
But in any case, why would 2 identical pages, each running against the
same version of the Toolkit, have different behaviour? And having done some further investigation, it is even more baffling. Yesterday the copy of the page which did not produce errors was in a different folder to the one that was failing. I
have just now placed a copy of the page which did not produce errors and placed in in the same folder as the failing page - and sure enough it produces the same errors! But I have also had the same error with pages in a separate web app, so it is not just
an issue with this folder. Is there some way that a particular combination of pages in a folder could be an issue?
Feb 25, 2014 08:48 AM|jstranger|LINK
when I put a copy of the parent page in a different folder and got no error, there
was actually a difference between that scenario and the original failing scenario - i.e. there was no child page in that folder. Hence when I set the iframe src in code behind, nothing was actually loaded (I had assumed that the child page was not
loaded until the button was clicked to show the modal popup, but this is clearly not the case). The likely reason for the error was the fact that I had a ToolkitScriptManager in both the master page for the parent page and that for the child page (by chance
I guess this is no longer the case. Anyway, I have for now removed the ToolkitScriptManager from the child's master page and have not encountered the error since. But (assuming that I have now resolved the issue) why this scenario should cause an intermittent
error before the child page is actually run is difficult to comprehend.
Feb 25, 2014 10:36 PM|chetan.sarode|LINK
Have you tried using the Developer Tools (F12) within your browser and checking the Console area to see if any particular errors are present?
Feb 26, 2014 09:08 AM|jstranger|LINK
Since my last post, needless to say, the problem has not completely gone away after I removed the ToolkitScriptManager from my child page - although it is now much less frequent (roughly 1 in 20 postbacks to the page raise the error rather than the 1 in
5 previously) - possibly because the child page is simpler. I still believe that it is some 'clash' (for want of a better term) between the parent page and the child page when the latter is running in an iframe, as I never had this problem previously when
I used to load essentially the same child page from essentially the same parent page using window.open. I must admit to not having had much experience with iframes, so would welcome any observations others may have on potential issues with this approach. I
am fairly certain that the error does not occur if the iframe src is not set in code behind (which I can test very easily simply by not logging in) or if the child page is missing. And I can get the error without clicking on the button to open the modal popup,
4 control in my child page, which will clearly do so. Is it possible that running CKEditor in a page in an iframe is unstable, even before the page is actually active?
One potential workaround that occurs to me is not to set the iframe src until the click of the button that opens the modal popup. I did actually try this originally but was doing so server-side which I guess will not work. Presumably I could set the OnClientClick
I have tried using the IE F12 tools, but haven't yet managed to get the error in that mode. Might that be significant? And if I do get a console message, will it give me more information than the VS2012 reported error?