User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,555 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,625 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 5607 | Replies: 8 | Solved
Reply
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Html header of a page changed programmatically?

  #1  
May 31st, 2004
A friend told me that it is possible to change the header of a html web page using the vb .net code. Is this true? If so how do you do it?
Formerly known as Slade.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Html header of a page changed programmatically?

  #2  
May 31st, 2004
Well I worked it out, here is how it's done.


The following is the html code.
 
<TITLE ID=pageTitle RUNAT=server> </TITLE>


Then the vb .net code:
Public Class MyPage 
Inherits System.Web.UI.Page 
Protected pageTitle As System.Web.UI.HtmlControls.HtmlGenericControl
Private Sub Page_Load(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles MyBase.Load 
pageTitle.InnerText = "Dynamic page Title" 
End Sub
End Class


Anyways, just thought I'd share my findings with you guys.

Slade
Last edited by slade : May 31st, 2004 at 10:02 pm. Reason: Editing errors
Formerly known as Slade.
Reply With Quote  
Join Date: Feb 2003
Location: Canada
Posts: 786
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Rep Power: 9
Solved Threads: 25
Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Html header of a page changed programmatically?

  #3  
Jun 1st, 2004
Nice work Slade, I may actually put that to some use!
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
Reply With Quote  
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Html header of a page changed programmatically?

  #4  
Jun 1st, 2004
thanks Paladine, glad I could help!
Formerly known as Slade.
Reply With Quote  
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Html header of a page changed programmatically?

  #5  
Jun 7th, 2004
I have been working with this code for a while now... after a few builds there is an error. What actually happens is in the aspx code, the "runat = server" disappears. This is more than likely because it isn't included in the <forms>tag</forms>


Anyways, just a little bit of extra info.

Slade
Formerly known as Slade.
Reply With Quote  
Join Date: Feb 2002
Location: New York
Posts: 862
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Rep Power: 12
Solved Threads: 15
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: Html header of a page changed programmatically?

  #6  
Aug 2nd, 2004
No, actually it's related to Visual Studio .NET's web page designer. When you are on the WYSIWYG ("Design") view of the page, it reformats your code, and sometimes screws up on tags. There is a setting to control what view you get when you double click on a file in the project window; I have it going to HTML View, which there is no problem with (I rarely use the designer for Web Development).
-Ryan Hoffman

ASP.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote  
Join Date: Jun 2004
Posts: 32
Reputation: jackster is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
jackster jackster is offline Offline
Light Poster

Re: Html header of a page changed programmatically?

  #7  
Aug 31st, 2004
can you do the name with the keyword metatag?
www.ansariltd.com
Reply With Quote  
Join Date: Feb 2002
Location: New York
Posts: 862
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Rep Power: 12
Solved Threads: 15
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: Html header of a page changed programmatically?

  #8  
Aug 31st, 2004
Yup. It works for every tag .
-Ryan Hoffman

ASP.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote  
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: Html header of a page changed programmatically?

  #9  
Aug 31st, 2004
Originally Posted by Tekmaven™
No, actually it's related to Visual Studio .NET's web page designer. When you are on the WYSIWYG ("Design") view of the page, it reformats your code, and sometimes screws up on tags. There is a setting to control what view you get when you double click on a file in the project window; I have it going to HTML View, which there is no problem with (I rarely use the designer for Web Development).

Lol I don't use it either, it's such a pain. I usually just build my project and view it in my browsers every now and then to make sure it's all ok .
Formerly known as Slade.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 9:34 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC