2013-11-04 4 views
0

편집기 검도 컨트롤에 내용 문자열을 표시하는 데 사용하려고하는 간단한 클래스가 있습니다. 속성을 편집기에 바인딩하는 데 문제가 있습니다. Razor를 사용하여 Kendo UI Web/MVC Editor에 Content String을 바인딩하려면 어떻게해야합니까?검도 UI 편집기에서 내용을 표시 할 수 없습니다.

public class Details 
{ 
    public int TextId { get; set; } 
    public string Content { get; set; } 
} 

public List<Details> TextDetails 
{ 
    get 
    { 
     return mDetails; 
    } 
} 




@model MyApp.MyModels.ContentModel 

@{ 
    ViewBag.Title = "EditorContent"; 
} 

<h2>Stuff To Display</h2> 

@(Html.Kendo().Editor() 
.Name("editor") 
.Value(Model.TextDetails.Content) 
//I thought I could just bind to the property.... How can I show the Content in the Editor? 
) 

답변

1

당신이해야 할 일 : Model.TextDetails.First().Content 그렇지 않으면 모든 것이 좋습니다. 아시다시피 Value()은 문자열 값만 필요하며 html 콘텐츠로 렌더링되므로 적절한 모델 속성 (문자열)을 제공하면 편집기가 손상되지 않습니다.

관련 문제