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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:37:34+00:00 2026-05-13T21:37:34+00:00

I have ajax code for asp.net (non-mvc) to call to a webMethod to get

  • 0

I have ajax code for asp.net (non-mvc) to call to a webMethod to get additional data from the server for a request. But I can’t seem to figure out the url to give my JQuery in MVC.

<script type="text/javascript" language="javascript">
function SubmitAjax(url, message, successFunc, errorFunc) {
    $.ajax({
        type:"POST",
        url:url,
        data:message,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success:successFunc,
        error:errorFunc
        });

};

I don’t want to pass the entire list of related data to a select list to every person that arrives at the page, as not all will need this functionality. So I’d like to call a controller or webmethod via JQuery, but can’t seem to find out how to address the URL in MVC.

I noticed this post:
JQuery Ajax call gets resolved to the current Controller Folder, Instead of root Folder

is $.getJson an mvc method? is this a good solution for my use case? I only need to return a string url, or an empty string if what i’m looking for is not found. Do I need to include a for the $.getJSon method? is that part of MVC or part of JQuery? Is the leading slash going to point to Application root or server root?

  • 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-13T21:37:34+00:00Added an answer on May 13, 2026 at 9:37 pm

    The problem was the webMethod Tag on the controller, that was needed or helpful in asp.net, but not in asp.net mvc

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

Sidebar

Related Questions

With ASP.NET MVC, it is common to have AJAX code(e.g. jQuery) to invoke web
I'm using an Ajax update panel and have recently added ASP.NET tracing code to
I am using asp.net MVC to develop an application that will have ajax interactions.
I have developed code with Ajax and jQuery. I have got a response from
I have this code that performs an ajax call and loads the results into
I have an Ajax.Net enabled ASP.Net 2.0 web site. Hosting for both the site
I have some jQuery code. I have called an Ajax function file, file.php, that
I have a basic ajax application, which will not work, instead the php code
I have always been for documenting code, but when it comes to AJAX +
I have written jQuery code, in files Main.html and ajax.php . The ajax.php file

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.