Reputation: 470
Am trying to look at JavaScript richtextboxes and currently looking at CKEDITOR version 4 for a webform c#.
My question is, every time I do postback I lose any styles I've done. Is there a way of storing the changes or stop CK from clearing the textarea ?
Upvotes: 3
Views: 3368
Reputation: 5475
you have to make the textarea
runat server
example :
<textarea class="ckeditor" runat="server" name="editor1" ></textarea>
making html control runat=server
will store its values in a viewstates between postbacks
Edit:
I've added these refrences to get my example work
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="ckeditor/styles.js" type="text/javascript"></script>
<link href="ckeditor/contents.css" rel="stylesheet" type="text/css" />
Upvotes: 2