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 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

Ask A Question

Stats

  • Questions 340k
  • Answers 340k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are using PHP >= 5.3, you could use… May 14, 2026 at 4:43 am
  • Editorial Team
    Editorial Team added an answer You have extra semicolon in your if clause. It simply… May 14, 2026 at 4:43 am
  • Editorial Team
    Editorial Team added an answer Is the address enclosed in double-quotes? Like: Name,Address,Email John Smith,"123… May 14, 2026 at 4:43 am

Related Questions

When my JavaScript code uses AJAX to call an ASP.NET MVC method, it passes
Here's the background info first. ASP.NET 2.0 Web Site with AJAX Extensions 1.0. I
I should start by saying that I am using ASP.NET using C# in a
The following .NET 3.5 code, placed in an aspx file, will trigger a JavaScript
I've got a grid which provides some links for users to download files. Files

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.