0

can i make html editor of asp.net ajax 2.0/3.5 to read a rtf file from a directory?

can i if yes then how please?

1 Answer 1

1

Yes, first; read file content.

// Specify file.
FileStream file = new FileStream(Server.MapPath("~\\files\\test.rtf"), FileMode.OpenOrCreate, FileAccess.Read);
StreamReader sr = new StreamReader(file);

// Read contents of file into a string
string cval = sr.ReadToEnd();

// Second; Set Content property of HTMLEditor.
htmlEditor.Content = cval;

// Close StreamReader
sr.Close();

// Close file
file.Close();
Sign up to request clarification or add additional context in comments.

4 Comments

��ࡱ�����������������>�������������������9 when i convert it is showing me this type of data can u help i think space is encoded in this type of ascii
when i convert? what do you mean by convert?
actully the file first was in docx file i uploaded the file and inserted it in sql server and retreive it in rtf file then i used html editor and displayed it in web from using ur code .
So, the problem in not regarding HTMLEditor as i think, it's regarding file process logic (word --> SQL Server --> rtf). I don't know exactly where is the issue, but it's regarding file conversion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.