1
"American | African | Asian"값이있는 테이블에 필드가 있습니다. 필드에서 값 형식을 가져 와서 텍스트를 분할하고 드롭 다운 목록에 바인딩하고 싶습니다. 나는htmlhelper를 사용하여 텍스트를 분할하십시오.
지금까지 내가 가진 MVC 3를 사용하고이 하나
public static SelectList SplitText(this HtmlHelper html, string texttosplit, string seperator)
{
return new SelectList(texttosplit.Split('|'));
}
하지만
@Html.DropDownListFor(model => model.EM_opt1Values, @Html.SplitText(this will have an error it will not accept model => model.EM_opt1Values))
[무엇을 시도해 봤습니까?] (http://mattgemmell.com/2008/12/08/what-have-you-tried/) – Iridio
업데이트 된 내용을 참조하십시오. – user335160