We help IT Professionals succeed at work.

Display RTF

kennysflau
kennysflau asked
on
1,857 Views
Last Modified: 2013-11-26
Hi Experts,

I'm using VS 2008. ASP.Net c#.

I'm writing a web application and have extracted some text in rtf format from database, is there any control which can display my rtf text?

Thanks!!!!!
Comment
Watch Question

Commented:
What about RichTextBox ?

Author

Commented:
Is there any sample? Could you pls elaborate?

Commented:
I don't know ASP classes. But in dotnet it's straightforward.

Use RichTextBox control and call method LoadFile() to load the rtf file.
Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008

Commented:
if yo are working with ASP, you can convert it to html for presenting purposes:
http://www.codeproject.com/KB/recipes/RtfConverter.aspx

Author

Commented:
I cannot find RichTextBox in my Toolbox?
Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008

Commented:
RTB is not available for webforms, that's why I suggested to convert the contents to html

Author

Commented:
jaime, i don't very understand the document. Sorry but I'm very green in .Net, would you please further elaborate? Do I need to add any reference or class... something like this? Thanks so much
Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008

Commented:
there is not a standard rich textbox control for asp, as I mentioned earlier, so, a good alternative is to convert the RTF file contents into html, so you can show it in a web page with easy.
The link I have provided points to a open source code to do this.

Commented:
There is a microsoft web cast: how to use a RichTextBox in asp.net.
But it's in german language only.
A useful link from the web cast is:

www.fckeditor.net/download

From there you can get "FCKeditor.net". A module which allows you to insert RichtTextBoxes in Visual Studio.

Maybe this will help you.

Author

Commented:
Is iit be possible to open my content with WordPad? Create a temp file in memory..... something like this...
Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008

Commented:
if you don't want to watch it on a separated windows and not the browser, just put a link to the document in the webpage. RTF files are automatically recognized by the OS.

Author

Commented:
Unluckily, The source is not a rtf file.

I'm extracting the data from database which is in rtf format, so I will have to create a "virtual" rtf file in the memory and write the data into it, then open it with word or wordpad.

For example, my extracted data is like:
{\rtf1\ansi\ansicpg950\deff0\deflang1033\deflangfe3076{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 abc \b ABC\b0\par
}
 
Software Architect
CERTIFIED EXPERT
Top Expert 2008
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.