Solved

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

Posted on 2014-11-24
1
494 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
Comment Utility
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

A Knowledge Base That Stays Up-to-Date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now