943,410 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Marked Solved
  • Views: 7846
  • ASP.NET RSS
May 31st, 2004
0

Html header of a page changed programmatically?

Expand Post »
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?
Similar Threads
Reputation Points: 115
Solved Threads: 7
Practically a Master Poster
Slade is offline Offline
633 posts
since Mar 2004
May 31st, 2004
0

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
Last edited by slade; May 31st, 2004 at 11:02 pm. Reason: Editing errors
Reputation Points: 115
Solved Threads: 7
Practically a Master Poster
Slade is offline Offline
633 posts
since Mar 2004
Jun 1st, 2004
1

Re: Html header of a page changed programmatically?

Nice work Slade, I may actually put that to some use!
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Jun 1st, 2004
1

Re: Html header of a page changed programmatically?

thanks Paladine, glad I could help!
Reputation Points: 115
Solved Threads: 7
Practically a Master Poster
Slade is offline Offline
633 posts
since Mar 2004
Jun 7th, 2004
0

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
Reputation Points: 115
Solved Threads: 7
Practically a Master Poster
Slade is offline Offline
633 posts
since Mar 2004
Aug 2nd, 2004
0

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).
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002
Aug 31st, 2004
0

Re: Html header of a page changed programmatically?

can you do the name with the keyword metatag?
Reputation Points: 10
Solved Threads: 1
Light Poster
jackster is offline Offline
32 posts
since Jun 2004
Aug 31st, 2004
0

Re: Html header of a page changed programmatically?

Yup. It works for every tag .
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002
Aug 31st, 2004
0

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 .
Reputation Points: 115
Solved Threads: 7
Practically a Master Poster
Slade is offline Offline
633 posts
since Mar 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Posting values to a payment gateway without using a form
Next Thread in ASP.NET Forum Timeline: Working with SQL's Text data type





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC