Last post Jan 28, 2009 04:00 AM by kani@work
Jan 27, 2009 01:45 AM|kani@work|LINK
Am creating a web based application using C#, ASP.NET. I have a requirement in my project - to have a control in my web page that would allow the users to enter text or copy paste image from the clipboard(say a snapshot). Is there a control in dotnet like
the clipboard control in windows?
I tried creating a RichTextEditor custom control wherein which i have problems in pasting images from the clipboard.
I also tried using the winform RichTextEditor control in my web form, but i have problems in setting and retrieving values from the RichTextEditor.
Has anyone tried using Silverlight/AJAX's RTE?
Please share your thoughts.
Jan 27, 2009 09:29 AM|donchevp|LINK
I don't think it is possible to paste image in a web rte. You may paste if you have it once in the control, but can't let's say from your desktop to let's say a blank page.
It should be already in the page in order to be able to copy / cut / paste it.
By the way - have you tried Telerik r.a.d controls? The editor seems to be powerful.
There are also two or three other commercial editors in the web.
There should also be few opensource projects.
Hope this helps to some degree.
Jan 27, 2009 11:27 PM|kani@work|LINK
I have tried using some third party editors like tiny MCE, FCK Editor, Freetexteditor,... But the problem with these controls is that when i try to paste a screenshot or say any image from my desktop (or any image from Clipboard), that doesn't work. If i
insert an image by specifying the physical path and then copy pasting the image inside the RTE works, as what u have mentioned.
I also tried using the normal Rich Text Editor in windows froms. I created it as a winform user control and embedded it inside my web form. Am able to copy/paste any image from the clipboard. But the problem with this is that, when i try to fetch the values inorder
to save it to the database, it doesnt work. Am not able to retrieve the values from the RTE control that's embedded inside the webforms.
I have not tried using Telerik r.a.d control. And am not supposed to use any of the third party controls. :(
Any help would be greatly appreciated. Thanks.
Jan 28, 2009 12:07 AM|donchevp|LINK
I am surprised you were able to use windows forms richtext in a web form. I didn't know it is possible. Can you please give me more information on how did you accomplished this task? It may help.
On your question - the problem with the web editors is that they use IFrame with document.DesignMode="on". But the IFrame is an ordinal HTML page (aspx, html, no matter). The HTML page resides on the web server, thus it is remote for your computer. So when
you try to paste the image the IFrame cannot request the actual file as it cannot acces your hard disk for security reasons.
There may be a way to use ActiveX, as it is in the local security context (as the user has permitted it to be there), but you may signifficantly cut the useability of yout application as I am not quite sure if ActiveX is supported by FireFox.
That's my conclusion for now. Write me about how did you added RichText box in Web application (including url if possible, so I can take a look on it) and we may find some other way to achieve your goal.
Jan 28, 2009 04:00 AM|kani@work|LINK
Thanks for your response. :) I created a windows form user control that has a richtexteditor in it. Then created a web form and embedded that user control in web page using the <object> tag.
Now that i am able to copy /paste image from clipboard, i tried to insert the corresponding info in the database. But am not able to retrieve data from the Rich text editor though the properties are set in user control.
Any idea of how the win form control embedded in web works??