oqtane.framework/Oqtane.Client/Modules/HtmlText/Index.razor

34 lines
873 B
Plaintext

@using Oqtane.Modules.HtmlText.Services
@using Oqtane.Modules.HtmlText.Models
@namespace Oqtane.Modules.HtmlText
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject HttpClient http
@inject SiteState sitestate
@((MarkupString)content)
<br />
<ActionLink Action="Edit" />
<br /><br />
@code {
string content;
protected override async Task OnParametersSetAsync()
{
try
{
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
if (htmltext != null)
{
content = htmltext.Content;
}
}
catch (Exception ex)
{
ModuleInstance.AddModuleMessage(ex.Message, MessageType.Error);
}
}
}