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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:35:51+00:00 2026-05-26T14:35:51+00:00

I am using the following code in a view and I am trying to

  • 0

I am using the following code in a view and I am trying to add the withdraw link at the end using an additional parameter but I get the following error:

System.ArgumentException: The parameters dictionary contains a null entry for parameter ‘personID’ of non-nullable type ‘System.Int32’ for method ‘System.Web.Mvc.ActionResult Withdraw(Int32, Int32)’ in ‘MaxMe2.Controllers.TeamController’. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.

<% if(Model.departmentsDisplayCheck) {%>
<table>
    <tr>         
        <th>Name</th>
        <th>Type</th>
        <th>Status</th> 
    </tr>

<% foreach (var dep in Model.departmentsList){ %>

    <tr>
        <td><%: Html.ActionLink(dep.Name, "Details", "Department", new { id=dep.DepartmentID}, null) %></td>
        <td><%: dep.DepartmentType.Type %></td>
        <td><%: dep.DepartmentStatus.Status %></td>
        <td><%: Html.ActionLink("Withdraw", "Withdraw", "Team", new { id = Model.personalInfo.PersonID, dep = dep.DepartmentID}, null)%></td>
    </tr>
<% } %>

The controller method that I am trying to call is this:

public ActionResult Withdraw(int personID, int departmentID)
    {
        .....
    }

How can I make this work? Thanks in advance!

  • 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-26T14:35:52+00:00Added an answer on May 26, 2026 at 2:35 pm

    Your parameters names do not match those sent by the action link. Try like this:

    public ActionResult Withdraw(int id, int dep)
    

    or update your ActionLink parameter names to match those of the action:

    <%= Html.ActionLink(
        "Withdraw", 
        "Withdraw", 
        "Team", 
        new { 
            personID = Model.personalInfo.PersonID, 
            departmentID = dep.DepartmentID
        },
        null
    ) %>
    

    and then:

    public ActionResult Withdraw(int personID, int departmentID)
    

    is going to work.

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

Sidebar

Related Questions

I am trying to add a row to a tableView using the following code.
I am using the following code to save values from a settings view that
I'm using the following code to serve uploaded files from a login secured view
I have created an alert view with two buttons using the following code: UIAlertView
I have the following code in a partial view (using Spark): <span id=selectCount>0</span> video(s)
I am using following code in rowdatabound function. Protected Sub gvwMileStone_RowDataBound(ByVal sender As System.Object,
I'm using following code but cannot return data from MySQL. This is the output:
I'm trying to make my sprites stay in screen borders using the following code:
I am trying to call up a modal table view controller using presentModalViewController but
I'm trying to pass keyword arguments to a Django view using a dictionary, but

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.