I have been reading about setting dynamic page titles in ASP.NET 2.0, in order to modify the "catalog.aspx" page of my web application. Most of the articles on this subject, however, seem to be describing somewhat complicated solutions for creating dynamic site maps, whereas I would just like to set the title of my catalog.aspx page to the name of the current category or product in my catalog.
Although I can see how to set the title property in code like so:
Sub Page_Load()<br />
Page.Header.Title = "The current time is: " & DateTime.Now.ToString()<br />
...I can't figure out how to dump the contents of a <%# Container.Name %> -type container into this statement.
I am using a 3rd-party shopping cart package (DotNetCart), that displays categories and products on the http://www.mywebsite.com/catalog.aspx page in typical catalog fashion:
http://www.mywebsite.com/catalog.aspx?CategoryID=200 (The category named "Handbags")
http://www.mywebsite.com/catalog.aspx?CategoryID=200&ItemID=13 (The category named "Handbags", and the item "Canvas Handbag")
In the above examples, I'd like to have the page title change to "My Website: Handbags" and "My Website: Canvas Handbag" respectively.
The third-party vendor's catalog control looks sort of like this (extra tags and declarative controls omitted):
<%# Container.Name %><br />
How would I go about displaying the catalog control's Category and ItemDetails' Names in my page title attribute? Thanks for any advice.