.cshtml is a mvc 3 razor specific page. It cannot just be served like an html page. So from jquery, if your "
sample
" view is rendered from "
Home
" controller, you will have to use "
/home/sample
" and not just "
sample.cshtml
".
For example, consider the following controller:
public class HomeController : Controller
{
public ActionResult sample()
{
return View();
}
}
The sample action method would return a view named "
sample.cshtml
" by default. So in order to get the contents of this page use
/home/sample
.
Hope this helps!