0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VBでRazor記法によるusingブロック記述

Posted at

経緯

Asp.NETのMVCをVisual Basicで触る機会があったのだが、
Razor記法はC#でのサンプルが多く、VBの不慣れも相まって書き換えに苦戦したので覚書。

usingブロック


@using(Html.BeginForm(new { @class = "myclass"})){
    //タグとか
}

@Using (Html.BeginForm(New With {.class = "クラス名"}))
    @<text>
        'タグとか
    </text>
End Using

vbでのUsing使用時のみ、変数宣言以外の記述は @<text> で囲まないとエラーになる。
本当は正解があるのか、これが正解なのかはわからないが、一応これでいけた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?