javascriptブロックで次のRazorステートメントを使用していますが、「True is undefined」ランタイムエラーが発生します。 @ Request.IsLocalはTrueのブール値としてレンダリングされます。ありがとうございました。javascriptスクリプトブロックでRazor @ Request.IsLocalを評価します。
<script type="text/javascript">
var test;
if (@Request.IsLocal || @Request.IsLocal == 'True')
{
test = 'local';
}
else
{
test = 'not loccal'
}
alert(test);
</script>