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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:41:38+00:00 2026-05-10T17:41:38+00:00

I have a controller with an action method as follows: public class InventoryController :

  • 0

I have a controller with an action method as follows:

public class InventoryController : Controller {     public ActionResult ViewStockNext(int firstItem)     {         // Do some stuff     } } 

And when I run it I get an error stating:

The parameters dictionary does not contain a valid value of type ‘System.Int32’ for parameter ‘firstItem’. To make a parameter optional its type should either be a reference type or a Nullable type.

I had it working at one point and I decided to try the function without parameters. Finding out that the controller was not persistant I put the parameter back in, now it refuses to recognise the parameter when I call the method.

I’m using this url syntax to call the action:

http://localhost:2316/Inventory/ViewStockNext/11 

Any ideas why I would get this error and what I need to do to fix it?

I’ve tried adding another method that takes an integer to the class it it also fails with the same reason. I’ve tried adding one that takes a string, and the string is set to null. I’ve tried adding one without parameters and that works fine, but of course it won’t suit my needs.

  • 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. 2026-05-10T17:41:38+00:00Added an answer on May 10, 2026 at 5:41 pm

    Your routing needs to be set up along the lines of {controller}/{action}/{firstItem}. If you left the routing as the default {controller}/{action}/{id} in your global.asax.cs file, then you will need to pass in id.

    routes.MapRoute(     'Inventory',     'Inventory/{action}/{firstItem}',     new { controller = 'Inventory', action = 'ListAll', firstItem = '' } ); 

    … or something close to that.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer In your original code you have: function videoOver(buttonMC,video,stream) { buttonMC.onRollOver… May 11, 2026 at 2:10 pm
  • added an answer So, some important concepts discussed here helped me to solve… May 11, 2026 at 2:10 pm
  • added an answer Try this: var q = from a in db.MyTable group… May 11, 2026 at 2:10 pm

Related Questions

I have an asp.net mvc application with a route similar to: routes.MapRoute(Blog, {controller}/{action}/{year}/{month}/{day}/{friendlyName}, new
Say I have a controller with an Index Method and a Update Method. After
I'm struggling here with a problem: I have a controller questions which has action
A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.
I'm looking for thoughts on how should I use Session in an ASP.NET MVC
I'm working on a sort of a CMS/Wiki application to help me experiment with
I have a simple form that is used to update an entity in my
I've got a form inside an <asp:Content> block that is being submitted to a

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.