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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:45:09+00:00 2026-05-14T19:45:09+00:00

I am using jquery ajax method on my aspx page to call a web

  • 0

I am using jquery ajax method on my aspx page to call a web method in the code behind.If the call fails,for any reason I would like to catch the error and display a meaningful message to the user.Following is my jquery ajax method code.

 $.ajax(
   {
   type:"POST",
   url:"Default.aspx/createitem",
   data:JSON.stringify({question : question, answer : ans, url : url, category : cat, maincat : maincat, validfrom : validfrom, validuntil :validuntil}),
   contentType:"application/json; charset=utf-8",
   dataType:"json",
   success:function(msg)
   {
   alert(msg.d);   
   //success code goes here
   },
   Error:function(xhr, status, error) {
      // Boil the ASP.NET AJAX error down to JSON.
  var err = eval("(" + xhr.responseText + ")");

  // Display the specific error raised by the server (e.g. not a
  //   valid value for Int32, or attempted to divide by zero).
  alert(err.Message);

      }

   }); 

But in case of any error like ‘missing parameter’ or something neither the success function nor the error function is getting executed an I had to check the response in firebug.Please could someone tell me what am I doing wrong?

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-14T19:45:09+00:00Added an answer on May 14, 2026 at 7:45 pm
     Error:
    

    should be

    error:
    

    lowercase

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

Sidebar

Related Questions

i call my asp.net page method like below code $.ajax({ type: POST, url: MyPage.aspx/GetItems,
I am using jquery ajax method on my aspx page,which will invoke the webmethod
I'm using jquery 1.7.2 for some ajax call onloud of an aspx page. ajax
i'm loading, using the JQuery ajax() method, an external page with both html and
I'm currently new into client-side programming, especially using the Jquery Ajax method to call
I am using jQuery ajax to pass a string array to a page method.
I am using jQuery to make an AJAX call to a ruby method in
I am making an AJAX call using jQuery to an .ascx control's method in
I'm loading a page containing a GMaps using the ajax() method of jQuery. The
I am using ASP.NET page methods with jQuery. Here is my code, $.ajax({ type:

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.