What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 16716 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > Getting Problem in taking the values from the database ...
Prasanna64

Getting Problem in taking the values from the database

Replies: 0 | Posted by: Prasanna64 on 5/9/2012 | Category: ASP.NET Forums | Views: 291 | Status: [Member] | Points: 10  


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


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

  No reply found.


Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2013 7:19:13 PM