SHARE
TWEET

Untitled

a guest Oct 12th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [HtmlTargetElement(Attributes = AttributeName)]
  2. public class InDomIfTagHelper : TagHelper
  3. {
  4.     private const string AttributeName = "idi,in-dom-if";
  5.  
  6.     [HtmlAttributeName(AttributeName)]
  7.     public bool InDomIf { get; set; }
  8.  
  9.     public override void Process(TagHelperContext context, TagHelperOutput output)
  10.     {
  11.         base.Process(context, output);
  12.         if (!InDomIf)
  13.         {
  14.             output.SuppressOutput();
  15.         }
  16.     }
  17. }
  18.    
  19. <li idi='false'>content</li>
  20. <li in-dom-if="true">content2</li>
RAW Paste Data
Top