2012-01-12 3 views
0

Radeditor를 사용하고 있습니다. 나는 클립 보드에서 컨텐트를 가져와 편집기 컨텐 (conten)으로 설정해야합니다.javascript를 사용하여 radeditor에 콘텐츠를 설정하는 방법

콘텐츠를 얻습니다. 하지만 편집기 페이지에 내용을 설정하면 비어있는 것으로 표시됩니다.

다음 코드를 사용하고 있습니다.

var content = window.clipboardData.getData("Text"); 

    if (content != null) { 
     editor.set_html = content; 

그래서 서버 측에서 콘텐츠를 바인딩하려고합니다. 그래서 pagemethods.i를 사용하여 서버 측 함수를 호출하면 스크립트 관리자에서 EnablePageMethods = "true"로 설정됩니다.

하지만 페이지 메서드가 정의되지 않았 음을 보여줍니다.

내 우선 순위는 자바 스크립트를 사용하여 콘텐츠로 설정됩니다.

어떻게 하시겠습니까?

감사합니다,

푸자

답변

3

을 :

var newValue = "control alt delete"; 
    $find("<%=RadEditor1.ClientID%>").set_html(newValue); 

감사합니다,

Dhaval Shukla

1

당신이 다른 방법을 사용할 수 있습니다

var editor = $find("<%=RadEditor1.ClientID%>"); 
    var stringVal = window.clipboardData.getData("Text"); 
    if(stringVal != null){ 
     editor.set_html(stringVal); //replaces the content of the editor with stringVal 
     editor.pasteHtml(stringVal); //pastes your string val at the cursor (Defaults to end of the content window if no cursor found) 
    } 

할 수 있습니다 여기에 전체 API 문서를 얻을 : http://www.telerik.com/help/aspnet-ajax/editor-pastehtml.html

관련 문제