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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:45:24+00:00 2026-05-26T20:45:24+00:00

I have a web method: [System.Web.Services.WebMethod] public static string getCharacterstics(int product_id, int lang_id) {

  • 0

I have a web method:

[System.Web.Services.WebMethod]
public static string getCharacterstics(int product_id, int lang_id)
{
    // code goes here...
}

I want to access it using PageMethods like:
(Provided the condition that i have Enable PageMethods in ScriptManager):

<script type="text/javascript">
    $(document).ready(
        function () {
            $('#characterstics').html("loading");
            // '<%= product_id_property %>' , '<%= this.LanguageID %>'
            PageMethods.getCharacterstics(0 ,0 , OnSave);
        }
    );

    function OnSave(result) {
    }
</script>

I get the error “the http verb post to access path.. is not allowed”

I googled it and search the SO too but does not get any solution regarding to it Based on ASP.NET Routing.

What i believe is that because of asp.net routing the service methods are not accessible.

In addition i think i cannot even use JSON because of asp.net routing too.

Any help is appreciated.

Updated:

If i run the page with this url:

http://localhost:2606/searchdetail.aspx

The web method executed successfully.

Now

I have routing like this:

       routes.MapPageRoute("searchdetail", "searchdetail/{ID}", "~/searchdetail.aspx");
        routes.MapPageRoute("searchdetail", "searchdetail", "~/searchdetail.aspx");

The set_path() will work only for case 2 i.e without ID but does not work with case 1

if i try

   http://localhost:2606/searchdetail

It works fine

but if i try to use:

http://localhost:2606/searchdetail/123

It gives error that object expected.

So set_path() is the option what should i write.

  • 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-26T20:45:24+00:00Added an answer on May 26, 2026 at 8:45 pm

    Currently, WebMethods don’t work transparently with the Routing framework. There is a work around. You have to access the PageMethods directly by doing the following in your javascript:

    PageMethods.set_path('/the/path/to/your/page.aspx');
    PageMethods.YourMethod(params, onSuccess, onFailure);
    

    I hope this helps.

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

Sidebar

Related Questions

I have this function: [System.Web.Services.WebMethod] public static string EditPage(string nodeID) { DataTable dt =
I have now something like this: public class Service1 : System.Web.Services.WebService { [WebMethod] public
If I have a web service method, e.g. [WebMethod] [XmlInclude(typeof(SportsCar)), XmlInclude(typeof(FamilyCar))] public Car[] GetCars()
I have an ASP.NET 2.0 web method with the following signature: [WebMethod] public QueryResult[]
In my asmx file, I have [WebMethod] [ScriptMethod] public void Method(IDictionary<string, CustomClass> objectOfCustomClass) {
I have jquery using ajax/json to grab an elements ID and then hits: [System.Web.Services.WebMethod]
I have a page based web method which works fine, using [WebMethod], i.e [WebMethod]
I have the following web service: [ScriptService] public class Handler : WebService { [WebMethod]
I have a simple web service like this: @WebService public class MyWebService { @WebMethod
I have an web service named AEWService.asmx with the following code: using System; using

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.