I need to pass array to POST method. But i'm obviously missing sometging My view look something like this:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Klausimynas.Models.Rezultat>" %>
<input type="text" name="x[1]">
<input type="text" name="x[2]">
<input type="text" name="x[3]">
<input type="text" name="x[4]">
<input type="text" name="x[5]">
<input type="text" name="x[6]">
<input type="text" name="x[7]">
My method declaration looks like this:
[HttpPost]
public ActionResult LetsTest(IEnumerable<Rezultat> rez)
and when i'm trying to extract data i'm getting Value can't be null. What i'm missing?
See Question&Answers more detail:os