Solved

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

Posted on 2014-11-24
1
523 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

770 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