Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement