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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:29:28+00:00 2026-06-05T09:29:28+00:00

I am trying to use jQuery to directly call ASP.NET AJAX page methods. I’m

  • 0

I am trying to use jQuery to directly call ASP.NET AJAX page methods. I’m using encosia.com as a reference. My inline javascript is

       <script type="text/javascript">
           $(document).ready(function() {
               // Add the page method call as an onclick handler for the div.
               $("#Result").click(function() {                   
                   $.ajax({
                       type: "POST",
                       url: "Default.aspx/GetDate",
                       data: "{}",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function(msg) {
                           // Replace the div's content with the page method's return.
                           $("#Result").text(msg.d);
                       }
                   });
               });
           });

            </script>
       <div id="Result">Click here for the time.</div> 

with my webmethod being

<WebMethod()> _
Public Shared Function GetDate() As String
    Return DateTime.Now.ToString()
End Function

I would use FF and check POST sent, but since where I’m at currently only has IE 7 this is a little hard to do. Other relevent information, ASP.net 2.0. Does anyone know what I’m doing wrong?


Update

web.config – pre-existing still not working

<httpModules>
  <remove name="FormsAuthentication" />
  <remove name="PassportAuthentication" />
  <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
  • 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-05T09:29:29+00:00Added an answer on June 5, 2026 at 9:29 am

    Since you’re using ASP.NET 2.0, you’ll need to install the ASP.NET AJAX Extensions, like Joe Enos mentioned. I have a bit more info on the necessary configuration work here: http://encosia.com/asmx-scriptservice-mistakes-installation-and-configuration/

    Additionally, the .d wrapper around the response is an addition that didn’t come until ASP.NET 3.5. So, even if you’ve got everything else working right, your msg.d will be undefined in ASP.NET 2.0. Omit the .d and just make that:

    success: function(msg) {
      // Replace the div's content with the page method's return.
      $("#Result").text(msg);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use jQuery UI tabs much like a Master Page in ASP.Net.
im trying to use jquery bbq for remembering page with ajax. but i wonder,
I am trying to use the jquery library in ASP.NET in a subfolder called
I am trying to use JQuery to submit a form without reloading the page.
So, I'm trying to make a simple call using jQuery .getJSON to my local
Trying to use JQuery to scroll through a ul li list using class next
I'm trying to use http://www.asual.com/jquery/address/ for history management, this works absolutely fine when we
Im trying to use jquery and ajax to submit a form and show the
I'm trying to use jquery validate. Following the example: http://docs.jquery.com/Plugins/Validation works great and I'd
I'm trying to use jQuery.scrollTo plugin with accordion (where one block expands after clicking

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.