Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146236 | Jul 27,2019 04:18 AM UTC | Jul 29,2019 09:09 AM UTC | Blazor | 1 |
![]() |
Tags: Rich Text Editor |
<button class="e-btn e-outline" @onclick="@getTextHtml">Text After Html</button>
<button class="e-btn e-outline" @onclick="@getHtmlText">Html After Text</button> // Button click to call the GetText and GetHtml method
<br><br>
<EjsRichTextEditor @ref="rte">
<p>Sample Text</p>
</EjsRichTextEditor>
<br>
<div>
<b>Text After Html result</b>
<br>
<pre>@output1</pre> // Used to print the output1 variable result in DOM
<br>
<b>Html After Text result</b>
<br>
<pre>@output2</pre> // Used to print the output2 variable result in DOM
</div>
@code{
EjsRichTextEditor rte;
private string output1 = "";
private string output2 = "";
private async void getTextHtml()
{
var text = await this.rte.GetText();
var html = await this.rte.GetHtml();
this.output1 = "getText method Result: " + text + "\n\n";
this.output1 = this.output1 + "getHtml method Result: " + html;
StateHasChanged(); // Used for append the current change of output1 variable into DOM
}
private async void getHtmlText()
{
var html = await this.rte.GetHtml();
var text = await this.rte.GetText();
this.output2 = "getHtml method Result: " + html + "\n\n";
this.output2 = this.output2 + "getText method Result: " + text;
StateHasChanged();// Used for append the current change of output2 variable into DOM
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.