I want to use CKEditor with DynamicData Web Site. The all examples that I have found are old version of CKEditor.
So How can I integrate CKEditor with asp.net dyamica data web site?
Any help will be greately appreciated.
İY
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What I did was to modify the MultilineText_Edit.ascx file + code-behind located in your Dynamic Data /FieldTemplates/ folder as shown below. Note that in my example you would need to reference jQuery and the CKEditor jQuery adapter, the latter most probably located in /ckeditor/adapters/jquery.js.
The idea is to use the
HiddenFieldcontrol with ID=”State” as carrier for the data. Notice the client-script that is registered in the overriddenOnPreRender(...): On any .NET form submission (here triggered by Dynamic Data trying to save, update or the like), the data from the CKEditor is saved to the State Hiddenfield, and the data is extraced from the FieldTemplate control from State via the overriddenExtractValues(...).To clarify: the reason for not returning contents of the
TextBoxcontrol, Editor, itself, is that this will return the initial contents of the control, discarding CKEditor changes. CKEditor needs to client-side render its markup and stuff to somewhere, and so we do this to the StateHiddenField(doing it to theTextBoxcontrol itself will mess stuff up, as far as I recall).One last thing: If you want to keep your MultilineText_Edit.ascx for normal non-CKEditor multiline text editing, put the code in a new file instead, e.g. MultilineHtml_Edit.ascx and set the UIHint for the property to “MultilineHtml” in the metadata class for your partial Linq2SQL class:
MultilineText_Edit.ascx
MultilineText_Edit.ascx.cs