Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HtmlTargetElement(Attributes = AttributeName)]
- public class InDomIfTagHelper : TagHelper
- {
- private const string AttributeName = "idi,in-dom-if";
- [HtmlAttributeName(AttributeName)]
- public bool InDomIf { get; set; }
- public override void Process(TagHelperContext context, TagHelperOutput output)
- {
- base.Process(context, output);
- if (!InDomIf)
- {
- output.SuppressOutput();
- }
- }
- }
- <li idi='false'>content</li>
- <li in-dom-if="true">content2</li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement