심재운 블로그

728x90
반응형

http://garyclarke.us/programming/markup-rendered-by-asp-net-mvc-html-helpers/

Html Helper Markup
Html.LabelFor
<label … >…</label>
Html.HiddenFor
<input type="hidden" … />
Html.PasswordFor
<input type="password" … />
Html.EditorFor
(DataType.Password)
<input class="text-box single-line password" type="password" … />
Html.CheckBoxFor
<input type="check" … />
Html.RadioButtonFor
<input type="radio" … />
Html.TextBoxFor
<input type="text" … />
Html.EditorFor

 

(default)

<input class="text-box single-line" type="text" … />
Html.TextAreaFor
<textarea … />
Html.EditorFor

 

(DataType.MultiLineText)

<textarea class="text-box multi-line" … />
Html.DropDownListFor
<select …>…</select>
Html.ListBoxFor
<select multiple="multiple">…</select>
Html.EditorFor

 

(bool)

<input type="checkbox" class="check-box" … />
Html.EditorFor

 

(bool?)

<select class="list-box tri-state" …>
  <option value="" … />
  <option value="true" … />
  <option value="false" … />
</select>
Html.ValidationMessageFor
<span class="field-validation-valid">…</span>
or
<span class="field-validation-error">…</span>
The classes “input-validation-valid” or “input-validation-error” are included in form input elements with associated validations.
Html.ValidationSummaryFor
<div class="validation-summary-error">
  <span>message</span>
  <ul>…</ul>
</div>
Html.EditorFor

 

(complex type)

<div class="editor-label">
  <%: Html.LabelFor(…) %>
</div>
<div class="editor-field">
  <%: Html.EditorFor(…) %>
  <%: Html.ValidatorFor(…) %>
</div>
Html.EditorforModel Same as EditorFor using the implicit view model.
Html.DisplayFor

 

(default)

Value
Html.DisplayFor

 

(bool)

<input type="checkbox" class="check-box" disabled="disabled" … />
Html.DisplayFor

 

(bool?)

Same as EditorFor when rendering a bool? type, with addition of disabled=”disabled” attribute.
Html.DisplayFor

 

(complex type)

<div class="display-label">
  <%: Html.LabelFor(…) %>
</div>
<div class="display-field">
  <%: Html.DisplayFor(…) %>
</div>

 

728x90
반응형

이 글을 공유합시다

facebook twitter kakaoTalk kakaostory naver band

본문과 관련 있는 내용으로 댓글을 남겨주시면 감사하겠습니다.

비밀글모드