Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Changing the title of an ASPX page


Message #1 by Francois_Vallieres@I... on Fri, 22 Feb 2002 00:56:13 -0500
Hey, you people are doing it the harder way (using that literal control) 
if u just want to change the Title of an aspx page b4 it is rendered.

Here is an example:

[ViewProduct.aspx]
<HEAD>
<title>SPINRetail: Product Information for <%=CurrentProductTitle%></title>
</HEAD>

[ViewProduct.aspx.vb]
Public CurrentProductTitle As String

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles MyBase.Load
   CurrentProductTitle = "Giordano Jeans"
End Sub

OR you use this way
aspx: <title><%=CurrentTitle%></title>

aspx.vb: CurrentTitle = "Product Information for Giordano Jeans"
or, even from a value from a database/Web Method
         CurrentTitle = myService1.GetProductTitle()


You can put <%=anyvariablename%> anywhere in your .aspx page, as long in 
code-behind, you have declared that variable as Public.

  Return to Index