CuteEditor in a DataGrid (ASP.NET / C#)

Last post 03-19-2009, 9:42 AM by Adam. 9 replies.
Sort Posts: Previous Next
  •  03-12-2009, 9:20 AM 49796

    CuteEditor in a DataGrid (ASP.NET / C#)

    Hi,
     
    Can you tell me how to use the CuteEditor with a DataGrid. There's a demo page but no HTML code.
     
    Many Thanks,
     
    Dave
  •  03-12-2009, 10:52 AM 49799 in reply to 49796

    Re: CuteEditor in a DataGrid (ASP.NET / C#)

    If I put the CuteEditor in a datagrid, I get the error:
     
    The name 'Editor1' does not exist in the current context at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at
  •  03-12-2009, 11:09 AM 49800 in reply to 49796

    Re: CuteEditor in a DataGrid (ASP.NET / C#)

    I have got it sort of working but cannot use it as a filepicker in a datagrid. I get this error:
     
    The name 'Editor1' does not exist in the current context at System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode) at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath) at .....
     
     
    Thanks,
     
    Dave
  •  03-12-2009, 12:05 PM 49806 in reply to 49800

    Re: CuteEditor in a DataGrid (ASP.NET / C#)

    Dave,
     
    You need to find the editor ID using FindControl method.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-13-2009, 4:29 AM 49834 in reply to 49806

    Re: CuteEditor in a DataGrid (ASP.NET / C#)

    Hi,
     
     
    Thanks for your reply. It seems to be pointing to this javascript line though....
     
    var editor1 = document.getElementById('<%=Editor1.ClientID%>');


    Any help would be appreciated,

    Dave
  •  03-13-2009, 6:10 AM 49837 in reply to 49834

    Re: CuteEditor in a DataGrid (ASP.NET / C#)

    I need the javascript otherwise the CuteEditor will not work as a file picker.
  •  03-13-2009, 3:11 PM 49868 in reply to 49837

    Re: CuteEditor in a DataGrid (ASP.NET / C#)

    If you don't want to use FindControl method to get the editor ID, you can get the editor be checking the html code.
     
    Right click in your browser, click view source.
     
    For example:
     
    <table cellspacing="0" cellpadding="0" _IsCuteEditor="True" id="CE_Editor1_ID"...
     
    </table>
     
    CE_Editor1_ID is the ID of Editor.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-19-2009, 5:21 AM 50060 in reply to 49868

    Re: CuteEditor in a DataGrid (ASP.NET / C#)


    Hi,
     
    Yes I would do this but when I view the source to see the how the cute editor controls are rendered in the datagrid they have dollar signs in the names e.g. id="DataListNews$ctl01$Editor1". I have to edit your callInsertImage javascript for this and the dollar signs make it fail.

    Any ideas?

    Thanks,

    Dave

     

  •  03-19-2009, 5:25 AM 50061 in reply to 50060

    Re: CuteEditor in a DataGrid (ASP.NET / C#)

    Hi,
     
    The cuteeditor renders like this:
     

    <!-- CuteEditor DataListNews$ctl01$Editor1 Begin -->

    <textarea name="DataListNews$ctl01$Editor1" id="DataListNews$ctl01$Editor1" rows="14" cols="50" class="CuteEditorTextArea" style="DISPLAY: none; WIDTH: 100%; HEIGHT: 100%"> </textarea><input type='hidden' name='DataListNews$ctl01$Editor1$ClientState' value=''/><input type='hidden' name='DataListNews$ctl01$Editor1$PostBackHandler'/><link rel="stylesheet" href="http://cutesoft.net/uhns-website/CuteSoft_Client/CuteEditor/Load.ashx?type=themecss&amp;file=style.css&amp;theme=Office2003&amp;EditorID=CE_DataListNews_ctl01_Editor1_ID" />
      <table cellspacing="0" cellpadding="0" _IsCuteEditor="True" id="CE_DataListNews_ctl01_Editor1_ID" style="background-color:White;border-color:White;border-width:1px;border-style:Solid;height:1px;width:1px;">
       <tr><td class='CuteEditorToolBarContainer' unselectable='on' valign='top'><div id="CE_DataListNews_ctl01_Editor1_ID_ToolBar" style="DISPLAY:none;">

       </div><div id="CE_DataListNews_ctl01_Editor1_ID_CodeViewToolBar" style="DISPLAY:none;">

       </div></td></tr><tr><td class='CuteEditorFrameContainer'><iframe id="CE_DataListNews_ctl01_Editor1_ID_Frame" src="http://cutesoft.net/uhns-website/CuteSoft_Client/CuteEditor/Template.aspx?Referrer=http%3a%2f%2fribc01%2fuhns-website%2fCMS-News.aspx" FrameBorder="0" title="EditArea" class="CuteEditorFrame" style="background-color:White;border-color:#DDDDDD;border-width:1px;border-style:Solid;height:100%;width:100%;">
        <noframes>Your browser doesn't support frames.</noframes>
       </iframe></td></tr>
      </table><img alt="Load" src="http://cutesoft.net/uhns-website/CuteSoft_Client/CuteEditor/images/1x1.gif?633730549400467357" onload="var url='/uhns-website/CuteSoft_Client/CuteEditor/Load.ashx?type=scripts&amp;file=IE_Loader';var xh=new ActiveXObject('Microsoft.XMLHTTP');xh.open('GET',url,true);xh.onreadystatechange=function(){if(xh.readyState!=4)return;eval(xh.responseText);CuteEditorInitialize('CE_DataListNews_ctl01_Editor1_ID',{'_ClientID':'CE_DataListNews_ctl01_Editor1_ID','_UniqueID':'DataListNews$ctl01$Editor1','_FrameID':'CE_DataListNews_ctl01_Editor1_ID_Frame','_ToolBarID':'CE_DataListNews_ctl01_Editor1_ID_ToolBar','_CodeViewToolBarID':'CE_DataListNews_ctl01_Editor1_ID_CodeViewToolBar','_HiddenID':'DataListNews$ctl01$Editor1','_StateID':'DataListNews$ctl01$Editor1$ClientState','_PostBackHandlerID':'DataListNews$ctl01$Editor1$PostBackHandler','_TemplateUrl':'/uhns-website/CuteSoft_Client/CuteEditor/Template.aspx?Referrer=http%3a%2f%2fribc01%2fuhns-website%2fCMS-News.aspx','Culture':'en-GB','Theme':'Office2003','ResourceDir':'/uhns-website/CuteSoft_Client/CuteEditor','ActiveTab':'Edit','ContextMenuMode':'None','MaxHTMLLength':'0','MaxTextLength':'0','TabSpaces':'3','ResizeStep':'100','BreakElement':'Div','URLType':'Default','EmptyAlternateText':'ForceAdd','ServerName':'ribc01','RenderRichDropDown':'True','EditorOnPaste':'ConfirmWord','ResizeMode':'ResizeCorner','DNNArg':'','PostBackScript':'__doPostBack(\x27DataListNews$ctl01$Editor1$PostBackHandler\x27,\x27\x27)','HelpPath':'/uhns-website/CuteSoft_Client/CuteEditor/Help/default.htm','DOCTYPE':'','BaseHref':'','EditorBodyStyle':'','EditorBodyId':'','EditorBodyClass':'','EditorSetting':'!3wEWAgUFZW4tZ2IFAyRhMbknjq5jrtMkXaJ27W9QtO3k!3BR6','ToggleBorder':'1','EnableBrowserContextMenu':'1','ConvertHTMLTagstoLowercase':'1','EnableAntiSpamEmailEncoder':'1','EnableStripScriptTags':'1','AllowPasteHtml':'1','UseHTMLEntities':'1','EncodeHiddenValue':'1','EnableObjectResizing':'1','MaintainAspectRatioWhenDraggingImage':'1'});};xh.send('');" style="display:none;" />

     <!-- CuteEditor DataListNews$ctl01$Editor1 End c1 ms124.9992-->
     
    Thanks,

    Dave
  •  03-19-2009, 9:42 AM 50072 in reply to 50061

    Re: CuteEditor in a DataGrid (ASP.NET / C#)

    Dave,
     
    The client ID of your editor is CE_DataListNews_ctl01_Editor1_ID.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML