Open Closed

Can't Create TagHelper in Abp Module #3247


User avatar
0
developer_infoline created

Hi,

I added UserListTagHelper class to my project.

I made my additions as shown below in _ViewImports.cshtml

@using ProfileModule.Web.TagHelpers; @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling @addTagHelper *, ProfileModule.Web.TagHelpers

<info-user-list></info-user-list> <email mail-to="Support"></email>

The above tags from within the index.html page are not working.

  • ABP Framework version: v5.2.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
namespace ProfileModule.Web.TagHelpers
{
    [HtmlTargetElement("info-user-list")]
    public class UserListTagHelper : TagHelper
    {
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
          
             ....
    }

    public class EmailTagHelper : TagHelper
    {
     
             .....
}

7 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try the code with the asp net core app which without abp?

  • User Avatar
    0
    developer_infoline created

    yes it works without abp

  • User Avatar
    0
    developer_infoline created

    I updated my method of adding tag helper but still not working in abp

    @addTagHelper ProfileModule.Web.TagHelpers.*, ProfileModule

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share a template project with me, liming.ma@volosoft.com

  • User Avatar
    0
    developer_infoline created

    Hi, I sent the project to your e-mail. Inside the TestModule Page <user-list></user-list> tags not working

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Update the src/TestModule.Web/Pages/_ViewImports.cshtml

    @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
    @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
    @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
    @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
    @addTagHelper *, TestModule
    
    @addTagHelper *, TestModule.Web
    
  • User Avatar
    0
    developer_infoline created

    thank you it worked

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11