1
In my application, I search the database for a string that contains RTF and need to load it into Aspxrichedit. And when necessary, save Aspxrichedit content to an RTF string to store in the database. How can I do this in C#?
I managed indirectly by creating files to open/save, but it is impracticable because of performance. IE, the form below is unviable.
aspx.Cs file
protected void Page_Load(object sender, EventArgs e)
{
string rtf = BuscaTexto();
string open = @"Projects/PCMSO/PCMSO/App_Data/WorkDirectory/open" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".rtf";
StreamWriter writer = new StreamWriter(open);
writer.WriteLine(rtf);
writer.Close();
ASPxRichEdit1.Open(open);
Delete(open);
}
public string Save()
{
string salvo = @"Projects/PCMSO/PCMSO/App_Data/WorkDirectory/save" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt";
ASPxRichEdit1.SaveCopy(salvo);
string rtf_string = System.IO.File.ReadAllText(salvo);
Delete(salvo);
return rtf_string;
}
aspx file.
<td>
<form runat="server">
<dx:ASPxRichEdit ID="ASPxRichEdit1" style="width: 100%; height: 400px" runat="server" WorkDirectory="~\App_Data\WorkDirectory"></dx:ASPxRichEdit>
</form>
</td>
Include your Mac Up
– Leandro Angelo
And its surroundings
– Leandro Angelo
@lucaswmloin, did you read the documentation of the component that I passed to you in the other question? https://documentation.devexpress.com/AspNet/119372/ASP-NET-WebForms-Controls/Rich-Text-Editor/Examples/How-to-Insert-RTF-text-a-document
– Leandro Angelo
Yeah, but it’s not working.
– user75204
Then include in your question the error presented.
– Leandro Angelo