can taghelper add js code?

mc 3,681 Reputation points
2023-06-07T06:04:34.7566667+00:00

I can write html to taghelper and can I write js code to it?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,164 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 56,021 Reputation points
    2023-06-07T19:38:57.5133333+00:00

    as a script block is just html, yes you can. If you are looking for something like webforms register startup script, than no. You could create a separate helper, placed in the layout section that rendered a collection of registered script.

    0 comments No comments

0 additional answers

Sort by: Most helpful