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

Include Telerik's version of jQuery directly via Response.Write

2 Answers 49 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 05 Oct 2010, 08:22 PM
Hello,

We have a particular situation in which I need to generate a response entirely server-side via Response.Write. We are using Telerik's embedded copy of jQuery and in this particular response, I need to include the jquery script. Doing a bit of investigation, I came up with this:

Response.Write("<script type='text/javascript' src='" + Request.ApplicationPath + "/Telerik.Web.UI.WebResource.axd?compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d1.0.61025.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1f0f78f9-0731-4ae9-b308-56936732ccb8%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-US%3ad89f6e67-3ab0-4fcf-b5f1-b51b735ae3d9%3a16e4e7cd%3af7645509%3a24ee1bba%3a1e771326%3aaa288e2d'></script>");

Not pretty and seems a bit unreliable. I tried to instantiate a RadScriptManager control server-side, add the core scripts programmatically and then call RenderControl on the manager object, but couldn't get around an exception thrown stating that the control must be inside of a <form runat="server">.

Is there a better way of doing this? Cleaner and standardized? What are the parameters for the Telerik.Web.UI.WebResource.axd?

Thanks,

Mike Oliver
Infotrieve, Inc.

2 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 12 Oct 2010, 04:16 PM
Hello Mike,

In your second approach, creating a RadScriptManager server-side. Did you try adding it to the Form. Like so:

this.Form.Controls.Add(RadScriptManager1);

I would think that would work, since it needs to be inside the Form tag.
0
Mike
Top achievements
Rank 1
answered on 12 Oct 2010, 11:04 PM
Cori,

Thanks for the idea. I tried it out and still got the same exception thrown stating that the control must be inside of a <form runat="server">. So, sticking w/ the long encoded script include for now.

- Mike
Tags
ScriptManager and StyleSheetManager
Asked by
Mike
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Mike
Top achievements
Rank 1
Share this question
or