English 中文(简体)
MVC 3 Razor - 如何阻止浏览引擎搜索 as和x页?
原标题:MVC 3 Razor - How to stop the view engine from searching the aspx and ascx pages?

我认为,我有小小小ug,并注意到,电能发动机不仅是为了我的raz子观点,而且是为了像px/ascx页。 (My bug是固定的)

难道有办法告诉它,只能搜索Razor探测器?

Here is the error message that was displayed:

The view  Index  or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Areas/BO/Views/Organization/Index.aspx
~/Areas/BO/Views/Organization/Index.ascx
~/Areas/BO/Views/Shared/Index.aspx
~/Areas/BO/Views/Shared/Index.ascx
~/Views/Organization/Index.aspx
~/Views/Organization/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Areas/BO/Views/Organization/Index.cshtml
~/Areas/BO/Views/Organization/Index.vbhtml
~/Areas/BO/Views/Shared/Index.cshtml
~/Areas/BO/Views/Shared/Index.vbhtml
~/Views/Organization/Index.cshtml
~/Views/Organization/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
最佳回答

页: 1 WebFormsViewEngine from ViewEngine.Engines , so that it only contained a RazorViewEngine.

例如:

ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new RazorViewEngine());
问题回答

如果您愿意在您的意见中采用习俗延伸,并建议设立<代码>ViewEngine。 文档Extensions = 新的[]{“cshtml”>,为你提供t work,同时检查有关问题:

具体地说,我的答复(或其它答复)





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签