リストビューを強く入力しました
取得する必要があるカスタムhtmlヘルパーがありますIEnumerable<object>
@model IEnumerable<MvcApplication2.Models.UserViewModel>
model( )をhtmlヘルパーに渡すことは可能ですか?
リストビューを強く入力しました
取得する必要があるカスタムhtmlヘルパーがありますIEnumerable<object>
@model IEnumerable<MvcApplication2.Models.UserViewModel>
model( )をhtmlヘルパーに渡すことは可能ですか?
ヘルパーが次のように定義されている場合:
public static IHtmlString SomeHelper(this HtmlHelper<IEnumerable<object>> html)
その場合、次のように呼び出すことはできません。
@model IEnumerable<MvcApplication2.Models.UserViewModel>
@Html.SomeHelper()
一方、次のように定義されている場合:
public static IHtmlString SomeHelper(this HtmlHelper html, IEnumerable<object> model)
ビューから呼び出して、モデルを渡すことができます。
@model IEnumerable<MvcApplication2.Models.UserViewModel>
@Html.SomeHelper(Model)