I have Telerik RadControls for ASP.NET AJAX Q1 2008 (v2008.1.619.20).
I am using the RadEditor to allow users to enter comments and notes on a form on a SharePoint site. The data is then stored in a TEXT field in a MS SQL database. The users generally copy and paste large amounts of information from Microsoft Word, but I want the information stored in MS SQL to be just plain text (i.e., not HTML). I am using this control because of its ability strip all formatting. I do NOT want any formatting and I want Microsoft Words curly quotes, curly apostrophes, and big hyphens to be converted to regular quotes, regular apostrophes, and regular dashes.
When I update the TEXT field in the database, I am using the .Text property of the RadEditor instead of the .Content property. This way, there should be no formatting to handle. However, Words curly quotes, apostrophes, and long dashes are still present in the .Text property. So I have code to replace these Words characters with regular characters.
This seems to work okay when I use this on an ASP.NET page. But when I put the exact same code on a SharePoint page, RadEditor returns different values in the .Text property.
Here is the .Text property from ASP.NET:
This line has Word curly "quotes", curly ‘apostrophes’, and long—dashes.
Here is the same .Text property from SharePoint:
This line has Word curly “quotesâ€, curly ‘apostrophes’, and long—dashes.
As you can see, the values are different. I captured these values using Visual Studio 2005 debug screen.
Can you tell me how why this is different and how I should use the RadEditor to enter just plain text and handle stripping out Words special characters?
Here is the RadEditor code I am using (exactly the same in the ASP.NET page and the SharePoint page):
<telerik:RadEditor ID="radEditor_Comments" runat="server"
ContentAreaCssFile="~/Styles/vt_RadEditor_ContentArea.css"
EditModes="All"
NewLineBr="true"
StripFormattingOnPaste="MSWordRemoveAll,AllExceptNewLines"
Width="100%" >
<Modules>
<telerik:EditorModule Name="RadEditorStatistics" Enabled="false" Visible="false" />
<telerik:EditorModule Name="RadEditorDomInspector" Enabled="false" Visible="false" />
<telerik:EditorModule Name="RadEditorNodeInspector" Enabled="false" Visible="false" />
<telerik:EditorModule Name="RadEditorHtmlInspector" Enabled="false" Visible="false" />
</Modules>
<Tools>
<telerik:EditorToolGroup />
</Tools>
</telerik:RadEditor>
Thanks,
Randall Price