here i am suppose to provide the client id of the textbox to CKEDITOR.replace but belowstatement
gives me error -"The name 'txtComment' does not exist in the current context" CKEDITOR.replace(document.getElementById('<%=txtComment.ClientID%>').value,
{ height: '100px', width:
'100%' });
the control id for every control placed in list view keeps changing on any insert or delete operation performed on listview control at runtime, becoz of which i am unable to bind
the textbox to CKEditor, i also tried to bind the CKEditor to textbox in listview's Databound Event like this:
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
None
0 Points
15 Posts
CKEditor not working properly in Listview Control
Apr 16, 2010 05:13 AM|daisy2205|LINK
I have used CKEditor in Insert item template and Edit Item Template in List view, for this i have used a textbox
<asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Text='<%# Bind("CommentDescription") %>'></asp:TextBox>
<script type="text/javascript">
CKEDITOR.replace(document.getElementById('<%=txtComment.ClientID%>').value, { height: '100px', width: '100%' });
</script>
here i am suppose to provide the client id of the textbox to CKEDITOR.replace but belowstatement gives me error -"The name 'txtComment' does not exist in the current context"
CKEDITOR.replace(document.getElementById('<%=txtComment.ClientID%>').value, { height: '100px', width: '100%' });
the control id for every control placed in list view keeps changing on any insert or delete operation performed on listview control at runtime, becoz of which i am unable to bind the textbox to CKEditor, i also tried to bind the CKEditor to textbox in listview's Databound Event like this:
TextBox CKInsertComment = (TextBox)lvSender.InsertItem.FindControl("txtComment");
String script = string.Empty;
script = Random rand = new Random(1);
@"CKEDITOR.replace('" + CKInsertComment.ClientID + "',{height:\"100px\",width:\"100%\"});";ScriptManager.RegisterStartupScript(this, this.GetType(), "CKeditorAdd1111" + rand.Next().ToString(), script, true);
but this also gives me error after some clicks, please help if anyone has tried useing CKEditor in ListView Control.
CKEditor
All-Star
44551 Points
13496 Posts
MVP
Re: CKEditor not working properly in Listview Control
Jul 10, 2010 01:46 PM|TATWORTH|LINK
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239