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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:30:59+00:00 2026-05-14T18:30:59+00:00

I have the folliwng JSON request code on an ASP.NET MVC web application: var

  • 0

I have the folliwng JSON request code on an ASP.NET MVC web application:

var userID = 'id=' + $('#namesList').val();
        $.getJSON('/Person/GetPerson/', userID, function(data) {
            $('#collar').text(data.collarNumber);
            $('#name').text(data.Name);
            $('#email').text(data.EmailAddress);
        });

This creates a request such as: http://localhost:48610/Person/GetPerson/?id=6. Why is there a question mark in there? I get the server error The parameters dictionary contains a null entry for parameter ‘id’ of non-nullable type ‘System.Int32’….

If I make the request manually without the question mark it works fine.

  • 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-14T18:31:00+00:00Added an answer on May 14, 2026 at 6:31 pm

    Parameters in the URL go, by definition, after an “?”. In MVC, route parameters are not actually parameters (for the web browser), but part of the path. As such, the correct code would be:

        var userID = $('#namesList').val();
        $.getJSON('/Person/GetPerson/' + userID, null, function(data) {
            $('#collar').text(data.collarNumber);
            $('#name').text(data.Name);
            $('#email').text(data.EmailAddress);
        });
    

    Replace null with a list of parameters when your controller actually accepts extra values not in the MVC route. Ex, your controller might be:

        public function GetPerson(string id, string type) {
             // your code
        }
    

    and you would call it like this:

        var userID = $('#namesList').val();
        var params = "type=XXX";
        $.getJSON('/Person/GetPerson/' + userID, params, function(data) {
            $('#collar').text(data.collarNumber);
            $('#name').text(data.Name);
            $('#email').text(data.EmailAddress);
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have follwing JSON: {mykey:[{name:Jak,interests:movies}]} and following opensocial app code: <script type=text/os-template require=mykey> <ul>
I have the followng code: var inputs = document.getElementsByTagName(input); for (var i = 0;
I am working on Gridview in ASP.NET(C#) and have cells that need to have
I have a JSON request which has follwing structure: formats: { flash_embed: http://a3.vikiassets.com/assets/vikiplayer-922746a667cfd38137a7e45df6ba1b95.swf?auto_play=true&language_codes=en&media_id=74965&partner=16&source=api_v3, m3u8:
I have the folliwng code working, however I feel that there is a cleaner
I have the follwing code where moreButton is a QPushButton . When I toggle
I have downloaded follwing code from one of Google Codes but problem is in
I have the follwing code. I want to get the value of the selected
I have the follwing code that provides an auto refresh feature to a WCF
I have the follwing code (which is not working): private void Window_PreviewKeyDown(object sender, KeyEventArgs

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.