无法获取未定义或空引用的属性“get_contentArea”

时间:2015-03-31 11:22:09

标签: telerik radeditor

这是使用Dynamic Rad Editor

 oEditor.OnClientLoad = "OnClientLoad()"

在调用此方法时我的Rad Editor无法正常工作它是禁用,工具和内容区域也被禁用。

这是我的javascript函数

 function OnClientLoad(editor) {  
    editor.get_contentArea().style.height = "417px";     
   // editor.getContentAreaElement().style.height = (417) + "px";

}

我收到此错误 无法获得财产' get_contentArea'未定义或空引用

   Dim oEditor As New Telerik.Web.UI.RadEditor()
    oEditor.ID = sField
    If bUnique = False Then oEditor.ID = sField & "[" & GetNextSeqNo.ToString & "]"
    oEditor.Height = iHeight * 20
    oEditor.Width = System.Web.UI.WebControls.Unit.Pixel(iUltimateWidth)

    SetEditorProperties(oEditor)

 Private Sub SetEditorProperties(ByVal oEditor As Telerik.Web.UI.RadEditor)

    oEditor.OnClientLoad = "OnClientLoad"
    'oEditor.ContentAreaMode = EditorContentAreaMode.Iframe
    'oEditor.ContentAreaCssFile = "~/Scripts/thumb-scroller.css"

    oEditor.ToolbarMode = EditorToolbarMode.Default
    oEditor.EditModes = EditModes.Design
    oEditor.NewLineMode = EditorNewLineModes.Br

    Dim uploadImages As String() = New String() {"~/Temp/MMRImages"}

    oEditor.ImageManager.ViewPaths = uploadImages
    oEditor.ImageManager.UploadPaths = uploadImages
    oEditor.ImageManager.MaxUploadFileSize = 2000000
    oEditor.ImageManager.AllowMultipleSelection = False
    oEditor.ImageManager.EnableAsyncUpload = True
    oEditor.ImageManager.EnableImageEditor = False

    oEditor.EnsureToolsFileLoaded()

如何添加此引用 请帮帮我

1 个答案:

答案 0 :(得分:1)

oEditor.OnClientLoad =“OnClientLoad()”应为

oEditor.OnClientLoad = "OnClientLoad"

注意函数名末尾的removed()。