Custom tag helper not working

前端 未结 8 1395
抹茶落季
抹茶落季 2021-02-03 19:11

I followed a few guides on creating a custom tag helper for ASP Core.

This is my helper:

using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.Asp         


        
8条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-03 19:44

    Another thing to check if you're finding you can't set your content with calls like:

    output.Content.AppendHtml("");
    output.Content.SetHtmlContent("");
    

    Is to check that you didn't use your tag helper as an empty/void element, e.g.:

    
    

    To add content the tag helper must have a closing tag:

    
    

提交回复
热议问题