A stupid question

shadowskull

Newcomer
Joined
Apr 17, 2002
Messages
10
Location
Waldorf, Md
Here's what I figure to be a stupid question but w/ an elusive answer.

I am creating another WEB application. I need to set the title property for the form in the VB script to based upon different settings. Does anybody know how to programmatically change the title property for the Web form? (Note: Me.Title = "" does not work the way it does in a Windows application).
 
In the *.aspx, add the following attributes to the Title tag:

<title ID="title" Runat="server"></title>

In the *.aspx.vb, add the following control declaration:

Protected WithEvents title As System.Web.UI.HtmlControls.HtmlGenericControl

Now you can programatically set the page's title:

title.InnerText = "Page Title"


 
Last edited:
Wow

talk about coming back from the dead...LOL.

That looks like it might work, but I think I did something different. I can't remember, after all that was two years ago.

:eek:
 
It works great. I use it all the time. You can use that method to access other html page tags as well, such as the Body tag.

Yeah, I guess I did raise this one from the dead. I was going to start looking at the old post to see which ones were never answered. I see if I could help. Someone might still have a question like it.
 
Good to know

That's very noble of you.

I should probably point out that at that time in 2002, the team I was on was still developing in .NET 2001. For anyone who still has their hands on the older versions of .NET, well, things didn't quite work right. :rolleyes:
 
Back
Top