You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My ultimate goal is to generate output for razor tags
I have a TagHelper With name Ad-Plus.cs
using Microsoft.AspNetCore.Razor.Runtime.TagHelpers;
using Microsoft.AspNetCore.Razor.TagHelpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace DevCore.TagHelpres
{
// You may need to install the Microsoft.AspNetCore.Razor.Runtime package into your project
[HtmlTargetElement("Ad-Plus")]
public class Ad_Plus : TagHelper
{
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.TagName = "div";
output.Attributes.SetAttribute("class", "hr-theme-slash");
output.Attributes.SetAttribute("data-toggle", "modal");
output.Attributes.SetAttribute("data-target", "#plusmodels");
@{
string template = "";
var service = RazorEngineService.Create();
service.AddTemplate("template", template);
service.Compile("template");
var result = service.Run("template");
} @Result
But the output result :
The text was updated successfully, but these errors were encountered:
My ultimate goal is to generate output for razor tags
I have a TagHelper With name Ad-Plus.cs
using Microsoft.AspNetCore.Razor.Runtime.TagHelpers;
using Microsoft.AspNetCore.Razor.TagHelpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace DevCore.TagHelpres
{
// You may need to install the Microsoft.AspNetCore.Razor.Runtime package into your project
[HtmlTargetElement("Ad-Plus")]
public class Ad_Plus : TagHelper
{
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.TagName = "div";
output.Attributes.SetAttribute("class", "hr-theme-slash");
output.Attributes.SetAttribute("data-toggle", "modal");
output.Attributes.SetAttribute("data-target", "#plusmodels");
}
Now I want to have a Render html TagHelper in output
@using RazorEngine;
@using RazorEngine.Templating;
@{
string template = "";
var service = RazorEngineService.Create();
service.AddTemplate("template", template);
service.Compile("template");
var result = service.Run("template");
}
@Result
But the output result :
The text was updated successfully, but these errors were encountered: