Setting HtmlMeta from outside class

I want to dynamically set the page Meta Tags based on certain criteria .. I'm using the following function..

The code works fine if placed in the same page, however, since what I want to do has more to do, I thought I want to place this code in a separate class and call it when I need it .. the problem is getting is issue:

'MyClassName' does not contain a definition for 'Header' and no extension method 'Header' accepting a first argument .... etc..

Featured Post

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.