Hi,
i got an error null reference exception was unhandled by unuser code.iam developing an application in asp.net mvc 3
my controller code
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
var de =
from i in dbContext.Usr_trainings
where i.Usr_training_id == 1
select i;
return View(de);
}
my view code
@model IEnumerable<OpenAccessModel1.Usr_training>
i give this reference
and retrieve the data using
@foreach (var item in Model)
{
<p>
@item.Usr_training_name
</p>
}
Reply |
Reply with attachment |
Alert Moderator