I am having this issue that keeps flagging up and I have checked every file. Just want to see if anyone else can spot an error?
@{
ViewBag.Title = "Event List";
}
<div>
Event Name : @Model.item.eventname <br />
Event Date : @Model.item.date <br />
Event Town : @Model.item.town <br />
Event Country : @Model.item.country <br />
Event Description : @Model.item.description <br />
Event Report : @Model.item.report <br />
@Html.ActionLink("Add New Event" , "AddEvent")
@*Html.Partial("EventList")*@
</div>
All reply's are much appreciated !
Bellow is the Event Model which is linked to the orginal post:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
namespace NETCW.Models
{
public class Event
{
public int EventID { get; set; }
[Required(ErrorMessage = "Please enter the event name.")]
public string eventname { get; set; }
[Required(ErrorMessage = "Please enter the event date.")]
public string date { get; set; }
[Required(ErrorMessage = "Please enter the event town.")]
public string town { get; set; }
[Required(ErrorMessage = "Please enter the event country.")]
public string country { get; set; }
[Required(ErrorMessage = "Please enter the event description.")]
public string description { get; set; }
[Required(ErrorMessage = "Please enter the event report.")]
public string report { get; set; }
}
}
See bellow edited I am getting a error it says it does not contain a definition for the following Date, Town, Country and Report :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
namespace NETCW.Models
{
public class Event
{
public int EventID { get; set; }
[Required(ErrorMessage = "Please enter the event name.")]
[Display (Name = "Event Name :")]
public string eventname { get; set; }
[Required(ErrorMessage = "Please enter the event date.")]
[Display (Date = "Event Date :")]
public string date { get; set; }
[Required(ErrorMessage = "Please enter the event town.")]
[Display (Town = "Event Town :")]
public string town { get; set; }
[Required(ErrorMessage = "Please enter the event country.")]
[Display (Country = "Event Country :")]
public string country { get; set; }
[Required(ErrorMessage = "Please enter the event description.")]
[Display (Description = "Event Description :")]
public string description { get; set; }
[Required(ErrorMessage = "Please enter the event report.")]
[Display (Report = "Event Report :")]
public string report { get; set; }
}
}
itemisnull