So I can use the designer mode? I'm relying less on asp.net mvc html helpers, but not totally ditching it, opting to use plain html (in which should have no problem being rendered in Design Mode) instead
Is this possible?
So I can use the designer mode? I'm relying less on asp.net mvc html helpers, but not totally ditching it, opting to use plain html (in which should have no problem being rendered in Design Mode) instead
Is this possible?
独自のビュー エンジンを作成する
public class MyRazorViewEngine : RazorViewEngine
{
public MyRazorViewEngine()
{
base.AreaViewLocationFormats = new string[]
{
"~/Areas/{2}/Views/{1}/{0}.html",
"~/Areas/{2}/Views/Shared/{0}.html",
};
....
含める残りの場所については、System.Web.Mvc.RazorViewEngine を参照してください。
次に、起動時に登録します
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new MyRazorViewEngine()));
RazorCodeLanguage.Languages["html"] = new CSharpRazorCodeLanguage();
そして、アプリケーションの web.config に以下を追加します
<system.web>
<compilation debug="true" targetFramework="4.5" >
<assemblies>
<add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
<buildProviders>
<add extension=".html" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/>
</buildProviders>
</compilation>
</system.web>
利点 - デザイナー モードを利用できます。欠点 - カミソリの強調表示とインテリセンスがすべて失われます。