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 8825697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:56:24+00:00 2026-06-14T06:56:24+00:00

I am trying to execute a PageMethod in aspx page using jQuery from a

  • 0

I am trying to execute a PageMethod in aspx page using jQuery from a html page, which works fine on my local machine. But when I deploy the web page to a remote production web server, then I get a 401 Unauthorized Error when the ajax request executes. My code is as below.

                  $.ajax({
                        type: 'POST',
                        url: 'SupplierMethods.aspx/GetAgeSummaryForPendingDocuments',
                        data: "{ 'supplierId': '" + vid + "'}",
                        dataType: 'json',
                        timeout: 180000, //3 minutes is timeout for this ajax request
                        contentType: "application/json; charset=utf-8",
                        beforeSend: function () {

                        },
                        success: function (json) {
                            stats = json.d.StatsBuckets;
                         },
                        error: function (xhr, textStatus, errorThrown) {
                            alert('An error occurred! ' + (errorThrown ? errorThrown : 
                            xhr.satus));
                        }

                    });
                });   

UPDATE : My problem was due to something very trivial. I copied over the website to remote server, but forgot to copy over the dll’s. the PageMethod is compiled into a dll in ASP.Net website, and because it was missing, so the call to a PageMethod through jQuery ajax came back with an error message. So it seems jQuery API for AJAX are as good as can be.

  • 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-06-14T06:56:25+00:00Added an answer on June 14, 2026 at 6:56 am

    I was getting this 401 error because the new dll in ASP.Net website that contained the PageMethod I was calling using jQuery ajax, was not deployed to remote server. So the moral of the story is – ALWAYS deploy your website with care so you don’t miss out on any files.

    And also make sure your syntax for calling ajax in jQuery adheres to the syntax.

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

Sidebar

Related Questions

I am trying to execute a local executable jar from an html page, so
Trying to execute a Powershell cmdlet from a MVC 3 Controller using impersonation but
I'm trying to execute ffmpeg from PHP using shell_exec or exec but it fails.
I`m trying to execute linux commant 'cat' from java code, but it does not
Am trying to execute ssis package using dtexec utility from c# app(Creating New Process,
I am trying to execute some Linux commands from Java using redirection (>&) and
When trying to execute the command cap deploy from a Windows machine, I'm getting
I am trying to execute this SQL command: SELECT page.page_namespace, pagelinks.pl_namespace, COUNT(*) FROM page,
I'm trying to execute a asp.net webservice using jquery. When I pass only one
I am trying to execute the following code from a firefox extension but it

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.