User4179525
User4179525

Reputation: 526

Page.Header.Controls.Add(css) for MVC razor view

Hi I am having an issue adding addition css styling to an existing class when the page loadsfor MVC razor view engine. Can anyone please help?

Upvotes: 0

Views: 974

Answers (1)

Nathan Anderson
Nathan Anderson

Reputation: 6878

The Page.Header property (and the Page class as a whole) is a WebForms concept and not available in the Razor. You can add additional elements to the head of a page using sections or even the ViewBag.

ASP.NET MVC explanation of @section

Upvotes: 1

Related Questions