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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:15:36+00:00 2026-06-18T00:15:36+00:00

I´m new with MVC. I´m using MVC4. I’m having an issue with a callback.

  • 0

I´m new with MVC. I´m using MVC4.
I’m having an issue with a callback. If I alert before and after the post() call both alerts show but the call doesn’t fire.

[HttpGet]
[Authorize]
public ActionResult Dashboard(int Menu)
{
 //some code
 return View("Dashboard");
}

<script>
    $(document).ready(function () {
        $.post("../Client/GetFact", {},
        function (data) {  
          //some code
        });
    });
</script> 

[HttpPost]
[Authorize]
public JsonResult GetFact()
{
    //some code to fill object_data

    var data = object_data;

    return Json(data);
}

As long as I leave ActionResult Dashboard without a parameter is works. If I add a parameter to Dashboard(int Menu) then the call back to GetFact doesn’t work.
I searched and found a similar post and follow the instructions given by you guys, but still does not work( looked at: getJSON not working if the mvc model view controller has a parameter).
I do not know what I’m doing wrong. Can you help? Thank’s!

  • 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-18T00:15:38+00:00Added an answer on June 18, 2026 at 12:15 am

    I do something similar with $.get, using jquery with the @Url.Action instead of the url.

    in addition to using the FormContext to pass to my Action :

    Place just before @using (Html.BeginForm())

    @{ ViewContext.FormContext = new FormContext(); }
    

    example :

    $.get('@Url.Action("ActionName", "ControllerName")', { IDName: $('#IdName').val() }, function (data) {
                        //Do Something here with the data
                    });
    

    I would imagine form post would be

    $.post('@Url.Ation("ActionName", "ControllerName")', function (data) {
                         //Do Something here with the data
                  });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to asp.net MVC, using MVC4 at the moment, learning by tutorials
After manually upgrading an ASP.NET MVC project to MVC4 using these instructions , how
I an fairly new to MVC, and have created an MVC4 application using EF-database-first.
I'm having an issue with the Twitter Bootstrap for ASP.Net MVC Check out http://nuget.org/packages/twitter.bootstrap.mvc4
Planning to create a new website for our product using ASP.NET MVC 4. Site
I'm new to using MVC and I'm trying to make a model that uses
I'm new to MVC (I'm using codeigniter) and was wondering where I should put
I will start new project which is based on ASP.NET MVC 3 using C#
I'm planning to design simple website using ASP.NET MVC new technology. Many concepts are
I'm very new to MVC, and just building my first site, using NerdDinner as

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.