Using RadAjaxManager + RadScriptManager in a base page which loads modules.( v2.826)
Since some days I am experiencing a strange problem on ajax postbacks: on every odd postback, I am loosing the images of skinned imagebuttons implied in ajax postback.
To be more explicit, I have a reset button which reset data in a tabstrip/multipage serie of data. First time I push it, it looses it image, second time it's back again, etc.
Same problem with buttons in a pager/datalist with itemtemplates: next page no more image for buttons in the itemtemplate of datalist, next page again, image are back. I checked it doesn't depends on displayed data.
I'am unable to find the reason why. When I suppress Ajax, everything works fine.
I am unable to recreate the problem on a small project and my project is too large to easilly debug.
It seems that client is loosing its path to server app.
Client sourcecode shows correct path for theses images, but they are not loaded, I have no error detected by IE7.
Is Ajax.net working on this path in any way ?
Thanks for help and suggestions.
7 Answers, 1 is accepted
Unfortunately from the provided explanation I cannot say for certain what might be the exact reason for the odd issue you are facing. There are a couple of things that you might want to test in order to trace the cause of the abnormality and tackle it:
- Does replacing the RadAjaxManager with plain MS UpdatePanels produce the same result with the styled image buttons?
- Does replacing the RadScriptManager control with standard ScriptManager makes a difference?
- What happens if you register manually the styles for the skinned buttons in the head section of the page (using <link rel='stylesheet' ... /> tag)?
The results from these tests can help us identify the core of the problem to eliminate it. You may also use the Fiddler tool or FireBug to inspect the traffic between the client and the server and see how the styles/images for the buttons are served on odd server submits.
the Telerik team
I have installed Fiddler and I think now that tehre is a problem with ajax and url rewriting.
MS, Telerik or me I don't know.
I found that after an ajaxified button click all the request for images and css resources using a theme are broken.
For exemple, on first page display I get something like:
GET /App_Themes/Web20/img/WT_next_en.gif HTTP/1.1
and after pressing the button:
GET /site/929/App_Themes/Web20/img/WT_next_en.gif HTTP/1.1
Here you may notice that the prefix '/site/929' is added: it is my 'false' url. My url rewritter normally transforms this in something understood by my application. But not for resources...
Next I saw that the page send back with this asynch session is far from being complete, I get something starting as this:
HTTP/1.1 200 OK
Date: Mon, 08 Sep 2008 17:52:33 GMT
Content-Type: text/plain; charset=utf-8
Set-Cookie: WTCRM_Lang_addonnice=en-US; path=/
Set-Cookie: PortalAlias=addonnice; path=/
Set-Cookie: WTCRMSecurity=CC0581B6-5C59-48B5-A5AE-A9D8F623036C@; expires=Mon, 08-Sep-2008 19:52:33 GMT; path=/
1318|updatePanel|WebHeaderButton_TPans_M_Creat_999_RadTabStrip1Panel|<div id="WebHeaderButton_TPans_M_Creat_999_RadTabStrip1" class="RadTabStrip RadTabStrip_Web20 RadTabStripTop_Web20 ">
<!-- 2008.2.828.35 --><div class="rtsLevel rtsLevel1">
<ul class="rtsUL"><li class="rtsLI rtsFirst"><a class="rtsLink rtsBefore" href="#">
Is it normal ? the isolated line
seems something broken.
Looks like some pb in Render ???
But I catch, trace and rethrow all exceptions in render on my code.
I will continue exploring, but if my results bring some idea...
Should I open a ticket ?
More info on my side but still no solution:
I have followed your suggestions for mymain page and my materpages:
1) replaced RadScriptMananger by ScriptManager
2) removed RadStyleSheetManager
3) also removed RadToolTipManager
4) removed formdecorator from aspx and ascx
5) removed all my own css
6) I still have a RadAjaxManager in main page(which is not using masterpage) and in all masterPages
In this configuration problem is still the same: on the first ajax postback IE stops loading from good place for themes and so never finds images.
I have tried adding a ControlAdapter to ensure that my page postson good url (Cf Scott Guru http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx )
No effect, in fact this last addition may not be working...
I have removed the RadAjaxManagerProxy settings and now I get postbacks but everything works Ok.
Replacing with an UpdatePanel is next step but its take more time.
Could this pb on IE side could be generated by Ajax ?
Again when I look a page source in IE, the scr element of IMG or INPUT is well formed, but fiddlers sees a GET for a bad url ????
Thank for comments.
Thank you for the additional information. Indeed it seems that the url rewriting causes the unwanted side effect in this case. What happens if you disable the url rewriting temporary? Does the same problem appear when you replace the ajax manager with standard MS UpdatePanels?
The results from these tests can shed some additional light on the matter in order to tackle it appropriately.
the Telerik team
What are the Telerik recommandations concerning Url rewriting and radControls usage ?
I'am certainly not the only to use it.
I believe that as long as your url rewriting logic is not in conflict with the ASP.NET AJAX framework and its asynchronous nature, it should function properly with our ASP.NET AJAX controls as well. That is the reason I asked you to test the same case with UpdatePanels instead of RadAjaxManager and let us know what your findings are.
the Telerik team
Finally I have solved my issue with themes/ajax+url rewriting.
It was on my side: all my skins were using relative path, so when the rawurl was a real one, IE was requesting with relatives path, but on some conditions, related to rawurl begining defferent from the first one, IE transforms the request url for images and css using the rewriten url.
And from this points things get worse.
It is a very common mistake but I forget to check it....take me 5 days....
Anyway, thanks for support.