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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:30:48+00:00 2026-05-30T22:30:48+00:00

ISSUE I am trying to submit an asp.net mvc form and I get the

  • 0

ISSUE

I am trying to submit an asp.net mvc form and I get the following error. When the page initially loads it hits the GridData method successfully. If I click the Submit button in the view below, I get the following error.

ERROR

The parameters dictionary contains a null entry for parameter ‘page’ of non-nullable type ‘System.Int32’ for method ‘System.Web.Mvc.JsonResult GridData(System.String, System.String, Int32, Int32)’ in ‘HunterEdge.Web.Controllers.DataController’. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

PARTIAL VIEW: This is the view data I’m trying to submit

@model HunterEdge.Web.Models.HarvestDataFilter

@using (Html.BeginForm("GridData", "Data"))
{
    <div style=" width:300px; height:550px; float:left">
         html removed for brevity

       <input type="submit" value="Search" style=" margin-left:110px" />
   </div> 
}

CONTROLER ACTION METHOD I’M TRYING TO GET FORM DATA TO

 public JsonResult GridData(string sidx, string sord, int page, int rows, HarvestDataFilter filter)
    {                        

        var results = (from a in db.t_harvest_statistics_elk
                        where a.year == "2008" && a.unit_number == 1
                        orderby a.id
                        select new { a.id, a.year, a.unit_number, a.total_hunters, a.bulls, a.cows }).ToList(); 

        int pageIndex = Convert.ToInt32(page) - 1;
        int pageSize = rows;
        int totalRecords = results.Count();   
        int totalPages = (int)Math.Ceiling((float)totalRecords / (float)pageSize);

        var pageResults = results.Skip(pageIndex * pageSize).Take(pageSize);           

        var jsonData = new
        {
            total = totalPages,
            page,
            records = totalRecords,
            rows = (
                from pageResult in pageResults
                select new
                {
                    id = pageResult.id,
                    cell = new[] { 
                                    pageResult.year.ToString(),
                                    "Add",
                                    pageResult.unit_number.ToString(),                                         
                                    pageResult.total_hunters.ToString(),
                                    pageResult.bulls.ToString(),
                                    "add",
                                    pageResult.cows.ToString(),
                                    "add",
                                    "add",
                                    "add"

            }
                }).ToArray()
        };
        return Json(jsonData, JsonRequestBehavior.AllowGet); 
  • 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-30T22:30:50+00:00Added an answer on May 30, 2026 at 10:30 pm

    You should filter the grid data in another way. The usage of Html.BeginForm is the wrong way. Look at the answer and use either the filter toolbar or advanced searching. If you do decide to use you custom <input> field you should use postData with the property defined as function (see here) and use .trigger("reloadGrid", [{page: 1}]) to send the searching request to the controller. In the case you should add new parameter which corresponds the property name in the postData to the list of parameters of GridData.

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

Sidebar

Related Questions

I am trying to learn asp.net MVC and having an issue to submit a
I am using asp.net MVC and I am having an issue posting a form
In an ASP.NET MVC application I am trying to submit multiple objects with a
I am having an issue on the controller side using ASP.Net MVC 3 trying
I'm trying to create asp mvc 3 page with a form with text fields
I'm trying to use form submit with jquery without a page refresh as demonstrated
I'm trying to submit a form with mechanize but have run into an error
I am having a small issue, I am trying to run a $(form#picform).submit after
I'm trying to learn a bit of ASP.net MVC 3 and I'm facing a
I am running into an issue with logging into an ASP.NET MVC web site

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.