what is the function of webpages:Enabled in MVC 3 web.config

前端 未结 3 1729
暖寄归人
暖寄归人 2020-11-29 03:26

I just started a new MVC 3 project. Can anyone tell me what


in my web.config file d

相关标签:
3条回答
  • 2020-11-29 03:30

    To allow Razor pages to be served, it's not enough to set <add key="webpages:Enabled" value="true" />. You also need to add the Microsoft.AspNet.WebPages package to packages.config using NuGet.

    0 讨论(0)
  • 2020-11-29 03:41

    According to documentation it prevents .cshtml and .vbhtml files from being accessed directly (www.myweb.com/views/home/index.cshtml for example)

    0 讨论(0)
  • 2020-11-29 03:52

    webPages:enabled with value false prevents .cshtml or .vbhtml files in the Views folder from being directly accessible from a web browser.

    0 讨论(0)
提交回复
热议问题