I have a public class like this:
namespace MyProgram.Common
{
public static class UIStrings
{
public const string Title = "Hellow World"
public const string SubTitle = "This is another string. Please click on '<a href=\"/Home/Status\" target=\"_blank">Here</a>'"
}
}
And then, on my Index.csthml I have the following code:
<label id="title" for="MyTitle">@Myprogram.Common.UiStrings.Title </label>
<label id="title" for="SubTitle">@Myprogram.Common.UiStrings.SubTitle </label>
The title renders fine but the link that I defined in the Subtitle doesn't render as a link but as the string itself.
Is there a way this can be done? I want to avoid to hardcode the strings in the cshtml file...
User Html.Raw
<label id="title" for="MyTitle">@Myprogram.Common.UiStrings.Title </label>
<label id="title" for="SubTitle">@Html.Raw(Myprogram.Common.UiStrings.SubTitle) </label>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With