I play with named arguments and optional parameters in C # 4.
In particular, I'm trying to use named arguments when calling HtmlHelpers in ASP.NET MVC, for example ...
@Html.DropDownList(name: "ItemGroup",
selectList: Model.ItemGroupList,
htmlAttributes: new { style="width:300px;" })
But what if I want to use strongly typed helpers that take a lambda expression as their first parameter instead of a string value?
@Html.DropDownListFor(expression: m => m.ItemGroup,
selectList: Model.ItemGroupList,
htmlAttributes: new { style = "width:300px;" })
The above code indicates an error in the lines "type arguments ... cannot be taken out of use".
By the way, this works fine ...
@Html.DropDownListFor(m => m.ItemGroup,
selectList: Model.ItemGroupList,
htmlAttributes: new { style = "width:300px;" })
, , - , -, , . , , - . , .