This repository has been archived on 2025-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
2019-09-15 12:21:32 +02:00

42 lines
994 B
Plaintext

@using Oqtane.Modules.HtmlText.Services
@using Oqtane.Modules
@using Oqtane.Modules.HtmlText.Models
@using System.Net.Http;
@using Oqtane.Modules.Controls
@using Oqtane.Shared;
@namespace Oqtane.Modules.HtmlText
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject HttpClient http
@inject SiteState sitestate
<ModuleMessage Message="@message" />
@((MarkupString)content)
<br />
<ActionLink Action="Edit" />
<br />
<br />
@code {
string message = "";
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)
{
message = ex.Message;
}
}
}