This is a migrated thread and some comments may be shown as answers.

[Solved] Problem with RadCompression and RadAjaxManager1.ResponseScripts jquery scripts

3 Answers 84 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 25 Mar 2009, 05:02 AM
Hi

I use RadAjaxManager1.ResponseScripts to inject some jquery code into my page on AJAX postbacks. However when I enable RadCompression, these postbacks no longer work.

Any idea why and is there a fix?

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 30 Mar 2009, 10:12 AM
Hello Michael,

I'm afraid that I'm unable  to re-create this behavior locally. I have attached a simple test page please take a look maybe I'm missing something obvious.

Best wishes,
Rosen
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 06 Apr 2009, 11:27 PM
Thanks for that. Your simple test page worked, however my javascript doesn't work when compression is enabled.
My JS is quite complex, it is not even giving a JS error in the Firefos error console when compression is enabled. the buttons just don't work period.

Here is a snippet of the kind of JS I am passing into the responsescripts.add method. I have omitted the other C# logic and just included the jscript creation lines.

string jscript = ""

jscript += "$j(\"#spanSchool_YearFinished\").hide();$j(\"#spanSchool_YearCurrent\").show();"
jscript += "$j(\"#spanSchool_YearFinished\").show();$j(\"#spanSchool_YearCurrent\").hide();"
jscript += "$j(\"#" + rblSchool_StillAttending.ClientID + "_0\").click(function() {$j(\"#spanSchool_YearFinished\").hide();$j(\"#spanSchool_YearCurrent\").show();});$j(\"#" + rblSchool_StillAttending.ClientID + "_1\").click(function() {$j(\"#spanSchool_YearFinished\").show();$j(\"#spanSchool_YearCurrent\").hide();});"
jscript += "$j(\"#addEditSchool\").slideDown(600);"
RadAjaxManager1.ResponseScripts.Add(jscript); 

0
Rosen
Telerik team
answered on 07 Apr 2009, 03:56 PM
Hi Michael,

Unfortunately I'm still unable to reproduce the behavior locally. Thus I will ask you to send us (attached to a formal ticket ) a small runnable example in which this behavior can be observed. This way we will be able to debug it locally and provide you with more to the point answer.

Kind regards,
Rosen
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Michael
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Michael
Top achievements
Rank 1
Share this question
or