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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:54:04+00:00 2026-06-08T13:54:04+00:00

I am trying to get an Ajax call to my controller and pass back

  • 0

I am trying to get an Ajax call to my controller and pass back a string… for some reason, I am unable to get down into my controller…
Not sure what I am missing…

$.ajax({
                url: dummyURL,
                success: function (result) {
                    $('#resultDiv').append('<b>' + result + '</b>');
                    setTimeout(function () {
                        window.location = RedirectUrl;
                    }, 1000);
                }
            });

This is how I set up my url string:

var dummyURL = '@Url.Action("AddPatient", "AddFoundPatient", new { FirstName = "-1", LastName = "-2", DOB = "-3", MRN = "-4", EMPIID = "-5", popID = (int)TempData["POPULATIONID"] })';

var FName = rowData['First_Name'];
            var LName = rowData['Last_Name'];
            var DOB = rowData['DOB'];
            var MRN = rowData['medipacId'];
            var EMPIID = rowData['EMPIID'];
            //Add Patient call
            var path = dummyURL.replace("-1", FName);
            path = path.replace("-2", LName);
            path = path.replace("-3", DOB);
            path = path.replace("-4", MRN);
            path = path.replace("-5", EMPIID);

This is the Action method that I am attempting to call…

public string AddFoundPatient(string FirstName, string LastName, string DOB, string MRN, string EMPIID, int popID)

This is the query string that I generate…

/AddFoundPatient/AddPatient?FirstName=BETTY &amp;LastName=WHITE &amp;DOB=1925-10-25 &amp;MRN=840108105 &amp;EMPIID=11011833 &amp;popID=2

I never hit the debbugging statements inside my action… What am I doing wrong?

  • 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-06-08T13:54:06+00:00Added an answer on June 8, 2026 at 1:54 pm

    The controller and action are mixed up

    var dummyURL = '@Url.Action("AddFoundPatient", "AddPatient", new { FirstName = "-1", LastName = "-2", DOB = "-3", MRN = "-4", EMPIID = "-5", popID = (int)TempData["POPULATIONID"] })';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to callback into my ViewResult Index() controller action from an ajax call
I'm trying to get a JSON from a webservice with javascript $.Ajax call. <script
I am trying to make an ajax call using $.get() where I want to
While trying to GET a JSON, my callback function is NOT firing. $.ajax({ type:GET,
I am trying to get a piece of data back using jQuery ajax via
I'm trying to call a server-side action in a controller from jQuery: $.ajax({ url:'http://localhost:88/admin/business/11/GetChildBusinessTypes',
I am really suffering here trying to get this ajax call to work, sorry
I'm trying to get a return value from an ajax call but I keep
I'm using ajax and trying to pass the Model back, which is a generic
I'm trying to call the 'tariff' action of my 'countries' controller using jQuery ajax()

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.