ASP.NET MVC HTTPPOST POSTING NULL MODEL

Goti Bandu

Total Post:119

Points:835
Posted by  Goti Bandu
 1528  View(s)
Ratings:
Rate this:

Form posts from webpage MakeBooking to FinalBooking to ascertain certain information such as number of guests, so the FinalBooking page can give you enough textboxes to input guest information for all guests required.

 

When in debug mode, both models in MakeBooking post are populated. After post, in FinalBooking, model is null.

 

    [HttpPost]

    public ActionResult MakeBooking(BookingModel model)

    {

        return RedirectToAction("FinalBooking", "Booking", new { model = model });

    }

 

    public ActionResult FinalBooking(BookingModel model)

    {

        return View(model);

    }

Any info would be appreciated.

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: ASP.NET MVC HttpPost posting null model

    It should work

    return RedirectToAction("FinalBooking", "Booking", model);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!