Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 21st, 2008, 08:13 PM
Authorized User
 
Join Date: Oct 2006
Posts: 42
Thanks: 3
Thanked 0 Times in 0 Posts
Default Setting a Page Title attribute from a webcontrol

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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Page links in forum title jimibt BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 October 17th, 2007 04:37 PM
trouble setting the onclick attribute cjwahlen Javascript How-To 0 May 18th, 2007 01:05 PM
Masterpage setting attribute psymonbassline ASP.NET 2.0 Basics 0 June 29th, 2006 01:18 AM
Setting Selected attribute of DropDownList in Grid jlrolin ASP.NET 1.0 and 1.1 Professional 0 June 13th, 2006 01:59 PM
Animated scrolling page title joshil Flash (all versions) 1 May 14th, 2004 03:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.