Solved

copy-paste from Word into an asp.net textBox!?

Posted on 2014-11-24
1
526 Views
Last Modified: 2014-11-25
Hi,

Some of my users copy-paste text from Word into a textbox on my ASP.NET webform, resulting in ? (question marks) being saved if the text contained some special Word character (like Word's apostrophes etc). How can I prevent or resolve this?

Thanks a lot!
0
Comment
Question by:Xeronimo
1 Comment
 
LVL 17

Accepted Solution

by:
selvol earned 500 total points
ID: 40461962
class MyInputBeaviour : InputBehavior
{
    public MyInputBeaviour(DocumentView view) : base(view)
    {
    }
 
    protected override bool ProcessKeyDownCore(KeyEventArgs e)
    {
        if (e.Control && e.KeyCode == Keys.V)
        {
             
            RadDocument document = this.DocumentView.Document;
            document.Insert((string)Clipboard.GetData("Text"), new StyleDefinition());
            e.SuppressKeyPress = true;
            return false;
        }
        else
        {
            return base.ProcessKeyDownCore(e);
        }
    }
}

Open in new window


As seen here
http://www.telerik.com/forums/paste-as-plain-text-428893c5f4d8

Selvol
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question