DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   Html header of a page changed programmatically? (http://www.daniweb.com/forums/thread6493.html)

Slade May 31st, 2004 10:42 pm
Html header of a page changed programmatically?
 
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?

Slade May 31st, 2004 10:59 pm
Re: Html header of a page changed programmatically?
 
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

Paladine Jun 1st, 2004 1:38 am
Re: Html header of a page changed programmatically?
 
Nice work Slade, I may actually put that to some use!

Slade Jun 1st, 2004 2:42 am
Re: Html header of a page changed programmatically?
 
:D thanks Paladine, glad I could help!

Slade Jun 7th, 2004 1:59 am
Re: Html header of a page changed programmatically?
 
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

Tekmaven Aug 2nd, 2004 12:55 pm
Re: Html header of a page changed programmatically?
 
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).

jackster Aug 31st, 2004 7:51 pm
Re: Html header of a page changed programmatically?
 
can you do the name with the keyword metatag?

Tekmaven Aug 31st, 2004 7:59 pm
Re: Html header of a page changed programmatically?
 
Yup. It works for every tag :).

Slade Aug 31st, 2004 10:24 pm
Re: Html header of a page changed programmatically?
 
Quote:

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 :).


All times are GMT -4. The time now is 6:47 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC