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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:49:55+00:00 2026-05-15T16:49:55+00:00

I am using JQuery & JSON (POST) to call webmethod. However I can call

  • 0

I am using JQuery & JSON (POST) to call webmethod. However I can call only webmethod located at aspx file but not in asmx file

Below are sample codes

CustomValidate.asmx

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel


Public Class CustomValidate
Inherits System.Web.Services.WebService

'ACCESS VIA JSON

<System.Web.Services.WebMethod()> _
Public Shared Function AJAX_Test(ByVal date1) As Boolean
...

    Return True
End Function
End Class

Javascript: JQuery JSON

function isDates(source, arguments) {
                var isValidDate;
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "CustomValidate.asmx/AJAX_Test",
                    data: '{date1: "' + arguments.Value + '"}',
                    dataType: "json",
                    async: false,
                    success: function(result) {

                        isValidDate = result;
                    },
                    error: function(httpRequest, textStatus, errorThrown) { 
                       alert("status=" + textStatus + ",error=" + errorThrown);
                    } 

                });
                arguments.IsValid = isValidDate;
            }

It always return javascript undefined error. But if I put the AJAX_Test webmethod in aspx page and replace the url: “CustomValidate.asmx/AJAX_Test” to “mypage.aspx/AJAX_Test”. It works fine. Any idea?

  • 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-15T16:49:55+00:00Added an answer on May 15, 2026 at 4:49 pm

    You are using what is known as a “Page Method”. That is, a static (Shared) method with a [WebMethod] attribute on it. These only work inside of an .ASPX page. They are intended to be used only by JavaScript running on the page.

    Try removing the Shared from the method and see if it works better.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Basically: everything. The app.config for the WCF service class library… May 16, 2026 at 4:05 pm
  • Editorial Team
    Editorial Team added an answer Like you, I have had a difficult time with the… May 16, 2026 at 4:05 pm
  • Editorial Team
    Editorial Team added an answer Use ST_Equals: http://postgis.refractions.net/docs/ST_Equals.html Your SQL statement will probably look something… May 16, 2026 at 4:05 pm

Trending Tags

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

Top Members

Related Questions

I am using jquery to loop through json object... But some how it doesn't
I am trying to call an ASMX from jQuery using JSON and get a
I am using jQuery to call web service (*.asmx) methods. The web service uses
Heh, I'm using jQuery AJAX Call to pull data from a self hosted webservice
Im using jQuery/PHP/MySql to load twitter search results on the page but limited to
I am using jQuery.ui.dialog.js to show the modal pop up.. But this Jquery.ui.dialog.js is
I'm using jquery to submit my form (with id #myForm here) as follows: $(document).ready(function()
I am using JQuery to execute an operation within a web service. After writing
I need to pre-load some values from a php script, I'm using a $.post
i'm trying to make my image search with google ajax search i'm using jQuery.

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.