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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:32:47+00:00 2026-05-31T23:32:47+00:00

I am currently trying to call a method in the aspx.cs inside of my

  • 0

I am currently trying to call a method in the aspx.cs inside of my javascript.

Below is what i currently have:

Javascript:

function loadPins(passValue) {
    callServer2("myMethod", passValue);
}

function callServer2(requestMethod, clientRequest) {
var pageMethod = "Default.aspx/" + requestMethod;

$.ajax({
    type: 'POST',
    data: clientRequest,
    dataType: 'JSON',
    contentType: 'application/json',
    url: pageMethod , //Method to call 
    success: function (result, status) {
        alert("success");
    },
    error: function (xhr, status, error) {
        alert("ERROR");
    }
  });
}

My aspx.cs:

 [WebMethod]
 public static string myMethod(string passedVal)
 {
     value = passedVal;
     return "true";
 }

When I debug I see it calling and entering CallServer2 but it never seems to hit my break point in my aspx. I dont see my sucess or error message alerts either.

Any suggestions?

Error I am Currently Getting:

error - <html>
        <head>
        <title> Unknow we method myMethod.<br>Parameter name:
     methodName</title>
     <style>
      body{font-family:verdana";font-weight:normal;font-size:
      .7em;color:black}
             p
     {font-family:"Verdana";font-weightbold;color:black;margin-top: -5px}
b{font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1{
font-family:"veranda";font-weight:normal;font-size:18pt;colour:red}
H2{
font-family:"Verdana";font-weight:normal ;font-size:14pt color:maroon}
pre{font-family:"Lucida Console";font-size .9em}
.marker{font-weight:bold;color:black;text-decoration:none;}
.version{color:gray;}
.error{margin-bottom:10px}
.expandable{text-decoration:underline, font-weight:bold; color:navy; cursor:hand;}
</style>
<head>

<code>
An unhanded exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
...

*Note I didnt put the … thats really all it says after the line above

  • 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-31T23:32:49+00:00Added an answer on May 31, 2026 at 11:32 pm
    $.ajax({ type: "POST", 
            url: pageMethod, contentType: "application/json; charset=utf-8",
            data: "{passedVal:" + JSON.stringify(clientRequest) + "}", dataType: "json",
             success: function (result, status) {
            alert("success");
        },
        error: function (xhr, status, error) {
            alert("ERROR");
        }
    
        });
    

    you should pass data with passedVal in data, and do stringify your variable. Hope this helps..

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

Sidebar

Related Questions

I'm currently trying to register a JS function call from a .NET page which
I am currently trying to call a method from my view to change a
I am currently trying to call a method from a utility class that will
I'm currently trying to make a set of conversion functions which, through one call,
I'm currently trying to write a Dump() method from LinqPad equivalent iin C# for
I am currently trying to use the multi Get method proposed by Enyim C#
I am currently trying to use a .net Task to run a long method.
I'm currently trying to teach myself more about javascript, and I find myself stumbling
I'm trying to dynamically call a method given in a string using parameters given
I'm getting the error: undefined method `model_name' for NilClass:Class when trying to call the

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.