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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:51:08+00:00 2026-05-25T16:51:08+00:00

I have a WebMethod which accepts one parameter. When I send a request to

  • 0

I have a WebMethod which accepts one parameter.

When I send a request to the webmethod without any parameters everything works well but when I supply a parameter to the same method, it returns entire site instead of a string.

The page parameter changes nothing except the content of the list.

List is just ListView which displays list of strings.

When I use URLRewriting the URL is different in instances that I supply a parameter from instances when I do not.

Can anybody help me with this problem?

My WebMethod:

[WebMethod]  
public static string GetResult(int id)  
{
    return "Hooray";
}

My web method call:

PageMethods.GetResult(docId,  
    function onSuccess(list) {  
        $(element).parent().siblings().filter(":first").append(list);  
    });

URL without parameter:
www.mywebsite.com/items is rewritten to www.mywebsite.com/items.aspx

URL with parameter:
www.mywebsite.com/items/1 is rewritten to www.mywebsite.com/items.aspx?id=1

  • 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-25T16:51:09+00:00Added an answer on May 25, 2026 at 4:51 pm

    Here’s a discussion about your same issue that might shed some light on the situation. Basically, what it says is that it’s not working because the handler that deals with PageMethods is looking for {pagename.aspx}/{methodname}, and your url rewriting is causing it to not recognize you are calling a page method.

    One suggestion on that page was to add the following in your javascript code somewhere after the auto-generated call of the same signature:

    PageMethods.set_path('/items.aspx');
    

    This will make it call your page method using the real url instead of the rewritten one.

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

Sidebar

Related Questions

I have a page based web method which works fine, using [WebMethod], i.e [WebMethod]
i have webservice with one method which recieves xml as string: [WebMethod] public int
I have a Web Service with one WebMethod for which return value is boolean.
I have a simple web service operation like this one: [WebMethod] public string HelloWorld()
I have a webmethod which is trying to construct xml data document and return
I have a webservice webmethod which saves the xml output to destination [WebMethod] [ScriptMethod(ResponseFormat
i have a simple asmx page with one web method which return array of
I have a VB.NET function which looks like this: <WebMethod()> _ Public Shared Function
I have the following web-service which works perfectly as long as it is accessed
I have class Country which has collections of Cities. At client I use webmethod

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.