Hello,
I have been reading about setting dynamic page titles in ASP.NET 2.0, in order to modify the "catalog.aspx" page of an online store. Most of the articles on this subject, however, seem to be talking about immensely complicated code 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:
Code:
Sub Page_Load()
Page.Header.Title = "The current time is: " & DateTime.Now.ToString()
End Sub
...I can't figure out how to dump the contents of a
Code:
<%# 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 "Cat Products")
http://www.mywebsite.com/catalog.aspx?CategoryID=200&ItemID=13 (The category named "Cat Products", and the item "Catnip Mice")
In the above examples, I'd like to have the page title change to "My Website: Cat Products" and "My Website: Cat Products: Catnip Mice" respectively.
The third-party vendor's catalog control looks like this (greatly simplified):
Code:
<dotnetCART:DisplayCatalog>
<CategoryTemplate>
<%#Container.Image%>
<br/>
<%# Container.Name %>
</CategoryTemplate>
<ItemDetailsTemplate>
<%#Container.Name%>
<br/>
<%#Container.ItemID%>
<br/>
<%#Container.Price%>
</ItemDetailsTemplate>
</dotnetCART:DisplayCatalog>
How would I go about displaying the catalog control's Category and ItemDetails' Names in my page title attribute? Thanks for any advice.