beytz
beytz

Reputation: 3

How do I inject html into the head section of an aspx page when using master page in VS2005

To be more specific, I'm using a master page and I want to insert rel='canonical' in some pages (for example when I'm using paging in a certain .aspx page).

I need to inject it in the head section of the master page:

This was a step in the right direction: ASP.NET masterpages: how to insert markup in the head section inside the aspx? but I need to have more control, to inject only when I have page=2 in the url.

Thanks

Upvotes: 0

Views: 600

Answers (2)

cgcarter1
cgcarter1

Reputation: 327

The head section of your masterpage should have it's own contentplaceholder. You can use the contentplaceholder on your subsequent pages in the head section and it will be 'injected' or placed for the page.

Upvotes: 0

Vitor Furlanetti
Vitor Furlanetti

Reputation: 451

The answer is just there in the link. You need to create an content place holder in the master page and then set it in the pages and conditionally set the rel type.

Upvotes: 1

Related Questions