I'm trying to pass an array from my controller to my view using my Model. My method does not work for some reason. I've posted it below.
Controller:
public ActionResult Confirmation()
{
string[] Array = new string[2] {"Pending", "07/07/2013"};
ConfirmationModel Con = new ConfirmationModel
{
Status = Array[0],
AppDate = Array[1],
};
return View();
}
Model:
public class ConfirmationModel
{
public string Status { get; set; }
public string AppDate { get; set; }
}
View:
@model site.ConfirmationModel
@{
ViewBag.Title = "Confirmation";
}
@Html.DisplayFor(Mode => Model.Status)
@Html.DisplayFor(Mode => Model.AppDate)