Skip to content Skip to sidebar Skip to footer

Rating In Asp.net Mvc4 Entity Framework

I am trying rating in asp.net mvc4 with entity framework, I have tried this code in cshtml but it is not working, please help me to achieve this. Its working while i am running in

Solution 1:

I assume you're working with razor engine. If so, don't do this:

<scripttype="text/javascript"src="D:\My Programs\FSLIndiaLatest\FSLIndiaLatest\Scripts\jquery.js"></script>

Instead, do this:

<scripttype="text/javascript"src="~/Scripts/jquery.js"></script>

EDIT

This applies to all your .js and .css files referenced by their absolute local paths. If ~/ feature doesn't work for you, try using relative paths: src="/Scripts/jquery.js"

All the files referenced in your html should be included in your project.

It may have worked for you before because you were accessing a simple local html page. If the html page is hosted on a server (as it is, when you're running an MVC 4 application), it cannot access local files.

Solution 2:

I thing your JS file not load properly.put your JS file in your application JS folder and give relative path of JS then your code definitely work.

Post a Comment for "Rating In Asp.net Mvc4 Entity Framework"