2011-05-16 6 views

답변

7

당신은 컨트롤러에서 초기 값을 설정할 수 있습니다 :

public ActionResult Index() 
{ 
    var model = new MyViewModel 
    { 
     MyProperty = "initial value" 
    }; 
    return View(model); 
} 

및 뷰에서 :

@model MyViewModel 
@Html.EditorFor(x => x.MyProperty) 
+0

그것은 버디 ... + 1 미세 감사를 작동 당신. – Garry

관련 문제