Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 120451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:48:48+00:00 2026-05-11T03:48:48+00:00

I have an ASP.NET server control which relies on JQuery for certain functionality. I’ve

  • 0

I have an ASP.NET server control which relies on JQuery for certain functionality. I’ve tried to add as a webresource.

My problem is my method of including the jquery file adds it to the body, or the form to be exact:

this.Page.ClientScript.RegisterClientScriptInclude(...) 

The alternative to this is to add it as a literal in the head tag:

LiteralControl include = new LiteralControl(jslink); this.Page.Header.Controls.Add(include); 

The problem with this however is any existing code srcs in the head which use JQuery fail, as JQuery is loaded afterwards (ASP.NET adds the literal at the bottom of the control tree).

Is there a practical way of making JQuery an embedded resource, but loaded in the head first? Or should I give up now.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:48:49+00:00Added an answer on May 11, 2026 at 3:48 am

    Update:

    A far easier way of doing it is to simply add the script tag dynamically, in your script and point to the google code hosting. e.g.

    function include_dom(script_filename) {     var html_doc = document.getElementsByTagName('head').item(0);     var js = document.createElement('script');     js.setAttribute('language', 'javascript');     js.setAttribute('type', 'text/javascript');     js.setAttribute('src', script_filename);     html_doc.appendChild(js);     return false; }  include_dom('http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js'); 

    The function is taken from this article


    Crecentfresh pushed me in the right direction, I also found

    http://en.csharp-online.net/Creating_Custom_ASP.NET_AJAX_Client_Controls—IScriptControl.GetScriptReferences_Method.

    My problem still remains though, the ScriptManager adds the references after the script in the head but I think this is an issue that can’t be resolved. I’ve opted to answer myself but also upvoted crescentfresh.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The distinction between quad.scale= 10 and quad.scale= MySin() Is minor.… May 11, 2026 at 11:45 pm
  • Editorial Team
    Editorial Team added an answer The "regex magic" you need is just sub (which does… May 11, 2026 at 11:45 pm
  • Editorial Team
    Editorial Team added an answer I don't know your DB-Wrapper you use, but I want… May 11, 2026 at 11:45 pm

Related Questions

I have an ASP.NET server control which relies on JQuery for certain functionality. I've
I have an asp.net server control (with the asp: in its definition). The button
I have an ASP.Net hosted website which displays a list of results as a
Possible Duplicate: .Net Changes the element IDs I have the following problem (I'll explain
I am using an ASP.Net Web Application project. I have a user control which

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.