How to call ASP MVC CSHTML View directly with “.cshtml” extension from browser

☆樱花仙子☆ 提交于 2020-01-03 04:56:11

问题


I want to call my asp mvc CSHTML View directly from browser with ".cshtml" extension like:

    www.mysite.com\receive.cshtml?...

instead

    www.mysite.com\receive?...

but i got 404

any idea ?


回答1:


1. By default IIS Request Filtering is configured not to serve requests to .cshtml files.

2. Razor views are not meant to be accessed directly by the client. yet, take a look at https://github.com/ServiceStack/RazorRockstars



来源:https://stackoverflow.com/questions/17803638/how-to-call-asp-mvc-cshtml-view-directly-with-cshtml-extension-from-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!