c# - Access Shared Resources from Tag Helper -


i'm trying access shared resources in tag helper, doesn't return value resource file though know exists, resourcenotfound. use ihtmllocalizer access shared resources in of views , works fine should configured correctly.

tag helper:

[htmltargetelement("lc:buy-button", attributes = "product", tagstructure = tagstructure.withoutendtag)] public class buybuttontaghelper : basetaghelper {     private readonly istringlocalizer<sharedresources> _localizer;      public buybuttontaghelper(apphelper app, istringlocalizer<sharedresources> localizer) : base(app)     {         _localizer = localizer;     }      public override void process(taghelpercontext context, taghelperoutput output)     {         .........          base.process(context, output);     }      private string processhtml(string html)     {         string result = html.replace("{?productid?}", this.product.tostring());         result = result.replace("{?subscribetext?}", _localizer["subscribebuttontext"].value);          return result;     }      [htmlattributename("product")]     public int product { get; set; } = -1; } 

solved installing nuget package microsoft.aspnetcore.mvc.localization


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -