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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:16:54+00:00 2026-06-13T00:16:54+00:00

I have get and post controller. But by httpPost comtroller passing model parameter values

  • 0

I have get and post controller.
But by httpPost comtroller passing model parameter values are null.
Why my httpPost model parameter values always null ??

[HttpGet]
        public ActionResult HireItem()
        {

            var HireItemListModel = new HireItemModel();

            HireItemListModel = new HireItemModel()
            {
                first_name = Session["first_name"].ToString(),
                middle_name = Session["middle_name"].ToString(),
                last_name = Session["last_name"].ToString(),
                ceremony_date = Session["ceremony_date"].ToString(),
            };         


            var product = _productService.GetAllHireProducts();

            if (product.Count != 0)
            {

                foreach (var proValue in product)
                {
                    var productVarSeparateList = _productService.GetHireProductVariantsByProductIds(proValue.Id, false);

                    foreach (var HireProSep in productVarSeparateList)
                    {
                        var productVarSeparateModel = new HireItemModel.HireItemSeparatetModel()
                        {
                            pname = HireProSep.Name,
                            price =HireProSep.Price,
                            pId=HireProSep.Id,

                        };
                        HireItemListModel.HireItemSeparatetlist.Add(productVarSeparateModel);
                    }
                    var productVarSetList = _productService.GetHireProductVariantsByProductIds(proValue.Id, true);

                    foreach (var HireProset in productVarSetList)
                    {
                        var productVarListset = new HireItemModel.HireItemSetModel()
                        {
                            pname = HireProset.Name,
                            price = HireProset.Price,
                            pId = HireProset.Id,
                        };
                        HireItemListModel.HireItemSetList.Add(productVarListset);
                    }
                }
            }

            return View(HireItemListModel);

        }

This controller HireItemModel model parameter values are null. WHY??

[HttpPost,ActionName("HireItem")]
    public ActionResult HireItem(string submitB, FormCollection formCollection, HireItemModel HireItemListModel)
    {
        var graduandList = _graduandService.GetGraduandBynameCeremony(HireItemListModel.ceremony_id, HireItemListModel.first_name, HireItemListModel.middle_name, HireItemListModel.last_name);
        foreach (var graduand in graduandList)
        {
            graduand.height = HireItemListModel.height;
            graduand.head_circumference = HireItemListModel.head_circumferenc;
            _graduandService.Updategraduand(graduand);
        }

this is my view.

@model HireItemModel
    @using (Html.BeginForm())
     { 

         <table  >

     <tr>
        <td >
          Ceremony : 
        </td>
        <td>
           Ceremony at @Model.ceremony_date

        </td>
    </tr>

      <tr>
                <td >
                  Name :
                </td>
                <td >
                   @Model.first_name  @Model.middle_name  @Model.last_name
                </td>
            </tr>
            </table>
         <div id="HItemType_1">
         @Html.CheckBox("HItemType")
       @*<input type="checkbox" name="test" value="test" id="HItemType"  />*@
         <label> Academic Dress Set</label>

         </div>
     <div id="HsetItem">


                @Html.Partial("_LoadHireSetItem", @Model.HireItemSetList)
      </div> 


          <div  id="HseparateItem">
                @Html.Partial("_LoadHireSeparateItem", @Model.HireItemSeparatetlist)
           </div>


         <table  >
         <tr>
         <td colspan="2">
         Please tell us your measurement:
         </td>
         </tr>
     <tr>
        <td >
        Height (in cm):
        </td>
        <td>
         @Html.EditorFor(model => model.height)


        </td>
    </tr>

      <tr>
                <td >
                 Head circumference (in cm):
                </td>
                <td >
                 @Html.EditorFor(model => model.head_circumferenc)

                </td>
            </tr>
            </table>

         <div>
        <input class="productlistaddtocartbutton" type="submit"  value="Add to cart" name="submitB"  id="btnaddtocart"/>
         </div>

     }

thanks.

  • 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-13T00:16:55+00:00Added an answer on June 13, 2026 at 12:16 am

    Make sure inside your view you have input fields for all values that you intend to use in your POST action. For example if you want to use the ceremony_id, first_name, middle_name, and last_name properties you need to include them:

    @Html.HiddenFor(model => model.ceremony_id)
    @Html.HiddenFor(model => model.first_name)
    @Html.HiddenFor(model => model.middle_name)
    @Html.HiddenFor(model => model.last_name)
    

    You could use hidden fields if the user is not supposed to modify their values but you could also have used text fields depending on your requirements.

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

Sidebar

Related Questions

I have a very simple question, How can I get the POST values from
I have an MVC controller that has this Action Method: [HttpPost] public ActionResult SubmitAction()
Using the code below my IEnumerable bookedRooms always have null values when they reach
Possible Duplicate: how to get GET and POST variables with JQuery? I have the
I have a struts2 web application which accepts both POST and GET requests in
I have a web service in which I am manipulating POST and GET methods
I am using the post and get methods for Ajax calls, and have a
I have created a Webpage which will post as post method..not as get method.
In my routes I have: resources :accounts This produces: accounts GET /accounts(.:format) accounts#index POST
In express, I have defined some routes app.post(/api/v1/client, Client.create); app.get(/api/v1/client, Client.get); ... I have

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.