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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:07:41+00:00 2026-06-12T15:07:41+00:00

I am having a problem calling an Edit method in an application I am

  • 0

I am having a problem calling an Edit method in an application I am creating. In the view an ActionLink is clicked that should be passing the order number to the Edit method as a parameter and opening an edit page with the info for the order populated in the fields. However upon clicking the link I receive the error:

The parameters dictionary contains a null entry for parameter ‘orderNum’ of non-nullable type ‘System.Int32’ for method ‘System.Web.Mvc.ViewResult Edit(Int32)’ in ‘AddressUpdater.WebUI.Controllers.OrderController’. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

However the parameter is present in the URL. Here are the relevant method:

public ViewResult Edit(int orderNum)
{
    Order order = repository.Orders.First(o => o.OrderNumber == orderNum);
    return View(order);
}

If if change the parameter to int? orderNum the page will render without an error but none of the data is there.

  • 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-12T15:07:42+00:00Added an answer on June 12, 2026 at 3:07 pm

    Most probably there’s something wrong with the sending of the data to the action method Edit, i.e. in your action link. Just open some devtool like Firebug or Chrome Dev tools to inspect what is being sent to the server.

    When your url looks like

    Edit?OrderNumber=1234
    

    then you need to have a matching parameter on your Action method like

    public ViewResult Edit(int orderNumber) {...}
    

    Instead

    Edit(int orderNum){...}
    

    won’t work. Basically url parameter name and action method parameter name have to match (not case sensitive, but the name has to match)

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

Sidebar

Related Questions

I am having a problem calling a model property from my view. I may
I'm having a problem with calling a function in a different class in QT
I am having a problem with Vlad on windows. After calling rake vlad:deploy I
I'm having problem with datagrid view. I have attached an image with the code
I'm having a problem with the a mysqli query I'm calling from a php
I'm having trouble calling a method in one Struts action from a method in
I'm having a problem with XSL variables. I know that once declared, the value
(EDIT: I have asked the wrong question. The real problem I'm having is over
I am having a problem that I can't seem to figure out. What I
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how

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.