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

  • Home
  • SEARCH
  • 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 3362058
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:13:37+00:00 2026-05-18T03:13:37+00:00

So here is the scenario: I am working with ASP.NET MVC 2 under the

  • 0

So here is the scenario:

I am working with ASP.NET MVC 2 under the 4.0 framework and have a page that calls the $.load on an Action link. This is all fine, it works as expected. The page that is loading has a call to a javascript file:

<script type="text/javascript" src="somejs.js"/>

This is failing and saying that “Method Not Allowed” as it is trying to POST this call instead of GET. I can see this happening with firebug.

I have another js file in the project that is included on all pages with a call to:

$.ajaxSetup({
    type: "POST",
    cache: false,
    timeout: 60 * 1000
});

this is so that I don’t have to make all of my $.ajax calls explicitly POST. If I change this to GET the $.load call works great. However, most of the rest of the site does not as Microsoft retired the GET method from MCV 2 or the 4.0 framework (I don’t really remember which).

I would rather not change all the $.ajax calls to POST explicitly, but I’m not sure what else to do at this point, so I was hoping to find an answer here.

Thanks.

  • 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. Editorial Team
    Editorial Team
    2026-05-18T03:13:38+00:00Added an answer on May 18, 2026 at 3:13 am

    The page that is loading has a call to a javascript file:

    Don’t inject HTML with <script> tags into the document using load() or html(). It’s highly unreliable cross-browser (and in jQuery, which may remove script tags completely depending on the situation), and even when it works it can cause you real confusion by loading the same script twice, potentially giving you duplicate definitions and handlers. (And of course, any script that relies on being executed at page load time is doomed.)

    If some script needs to be executed after a page load, either keep that code in static script and execute it in the ajax/load callback function, or have the server return a JSON object containing the code in a string separately from the HTML.

    I would rather not change all the $.ajax calls to POST explicitly

    If you really must try to load <script> tags dynamically you would have to… either that or change the call to ajax() in jQuery-1.4.3.js line 4978 to include an explicit type: 'GET' setting. Arguably it’s a jQuery bug that this isn’t included. But on the other hand the whole premise of AJAX-loading <script> is flawed.

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

Sidebar

Related Questions

I had a simple working (ASP.NET) Scenario here: 3 asp:RadioButtons that each have OnCheckedChanged
So, here's the scenario : I have a page in my asp.net c# based
Here's the scenario: You have an ASP.Net application supported by a Microsoft SQL Server
Here's my scenario - I have an SSIS job that depends on another prior
Here is the scenario that I have. I have a cvs repository in one
Here's the scenario: You have a Windows server that users remotely connect to via
Here's the scenario: I have a textbox and a button on a web page.
I am working through the above Tutorial from ScottGu located here ( http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-6-using-user-controls-to-implement-master-detail-scenarios.aspx )
Here's a classic works on my machine, but not in production scenario. ASP.NET app
Here is the scenario... I have a a checkbox next to each field that

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.