The next generation of the Teknik Services. Written in ASP.NET.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
875 B

using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
using System;
using System.Collections.Generic;
using System.Text;
namespace Teknik.Utilities.TagHelpers
[HtmlTargetElement(Attributes = "conditional")]
public class ConditionalElementTagHelper : TagHelper
public bool Condition { get; set; }
public ViewContext ViewContext { get; set; }
public override void Process(TagHelperContext context, TagHelperOutput output)
base.Process(context, output);
if (!Condition)
output.TagName = string.Empty;