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

3 posts, 0 answers
  1. Mike
    Mike avatar
    36 posts
    Member since:
    Sep 2012

    Posted 05 Oct 2010 Link to this post

    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. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 12 Oct 2010 Link to this post

    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.
  3. Mike
    Mike avatar
    36 posts
    Member since:
    Sep 2012

    Posted 12 Oct 2010 Link to this post

    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
Back to Top