if ブロック内に JavaScript コードを配置するにはどうすればよいですか。
@{
#if DEBUG
$("#User").val("JDoe");
$("#Password").val("secrect");
#endif
}
上記のコードを試すと、次のコンパイラ エラーが発生します。
Compiler Error Message: CS1056: Unexpected character '$'
$ を jQuery に変更すると、次のようになります。
Compiler Error Message: CS0103: The name 'jQuery' does not exist in the current context
私の意見では、Razor パーサーのバグです。どうすれば回避できますか?