Setting or adding to a page title through .NET UC? Options
Itamar
Posted: Wednesday, September 24, 2008 11:11:23 PM
Rank: Devotee

Joined: 10/30/2007
Posts: 95
Location: Israel
Hi all,

I'm trying to find a way to add to a page title (retrieve, concat, and replace with existing) from a .NET user control. In my installation we have different pages, some of them contain user controls that display data. For SEO reasons, we would like to be able to use the info we load in those controls to set the title of the containing page. I could use an XSLT extension, but I'm trying to find a way that will relieve the need for an extra external .NET call.

I tried accessing Me.Page.Header.Title (in our VB.NET UC) in Page_Load of the UC but with no luck; anyone has a better idea?

Itamar.
Adz
Posted: Wednesday, September 24, 2008 11:46:35 PM

Rank: Aficionado

Joined: 6/5/2008
Posts: 148
Location: United Kingdom
in umbraco v4 i think you can use

<head runat="server"/>

Then you can use code, Page.Header.Title="whatever"

Alternatively you could use master templates:
Put a content place holder inside the head tag?



Adam Perry (blog, twitter), developing Umbraco based websites and applications for ConnectDigital.
Itamar
Posted: Sunday, October 19, 2008 1:06:59 PM
Rank: Devotee

Joined: 10/30/2007
Posts: 95
Location: Israel
Those are v4 methods; any simpler way I could use with v3.x? What I had in mind was an XSLT macro (which will also get cached, thats a plus) in the page title, and pass it some sort of parameter to indicate which page I'm loading. If no better ideas come through, I might just do that...

Anyone?

Itamar.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.