Getting Problem in taking the values from the database

Posted by Prasanna64 under ASP.NET on 5/9/2012 | Points: 10 | Views : 768 | Status : [Member] | Replies : 0
In My controller i write this 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);


}

In my view
@model IEnumerable<Sampleone.Usr_training>

@{
ViewBag.Title = "Home Page";
}

<h2>@ViewBag.Message</h2>
<p>
To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
</p>
<script type="text/javascript">

var url = '/Home/Index'
$.ajax({ type: "GET",
url: url,

dataType: "json",
error: function (xhr, status, error) {
alert(error);
},
success: function (json) {
alert("Data Returned: " + json.Usr_training_name);
}
});


</script>

When i run this i get an parse error

Could not load Sampleone.MvcApplication

please help me if anyone knows




Responses

(No response found.)

Login to post response