1

I am trying to call a webservice method from .aspx page thro' javascript & i get this error, i do have [WebMethod] on the top of the c# method. Unknown web method [object Object].
Parameter name: methodName

    <h2> <i>Unknown web method [object Object].<br>Parameter name: methodName</i> </h2></span>

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    <br><br>

    <b> Exception Details: </b>System.ArgumentException: Unknown web method [object Object].<br>Parameter name: methodName<br><br>



[ArgumentException]: Unknown web method [object Object].
Parameter name: methodName
   at System.Web.Script.Services.WebServiceData.GetMethodData(String methodName)
   at System.Web.Script.Services.RestHandler.CreateHandler(WebServiceData webServiceData, String methodName)
   at System.Web.Script.Services.RestHandler.CreateHandler(HttpContext context)
   at System.Web.Script.Services.RestHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
   at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2
  • 2
    Thanks for showing the exception you received, but you need to show the code. At a guess, is your method static? Commented Jan 26, 2011 at 1:38
  • then create an example service that has the same problem. Commented Jan 26, 2011 at 3:48

1 Answer 1

2

1 - I think that your answer is there:
How to call webservice in Javascript for Firefox 3.0

It illustrates the use of [System.Web.Script.Services.ScriptService()] using a very easy and clean code and style.


2 - Alternativelly, you could use jQuery as illustrated in this answer: How to use jQuery to call an ASP.NET web service?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.