Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - dynamic title head
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

dynamic title head

 Post Reply Post Reply Page  12>
Author
CountAnton View Drop Down
Newbie
Newbie
Avatar

Joined: 18 February 2003
Location: United Kingdom
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote CountAnton Quote  Post ReplyReply Direct Link To This Post Topic: dynamic title head
    Posted: 18 February 2003 at 10:00am

Is their a simple way to reference the <title> tag as a html control so that the text it contains can be entered programatically?

It was easy enough to do this when I had the code in the same file as the html content, but I have since started using codebehind to put the code in a 'aspx.cs' file.  All the other web controls ended up having to be declared as something like...

protected System.Web.UI.WebControls.Label Heading;

But I can't seem to find any equivelent for the title tag.  Is there one?

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 20 February 2003 at 7:36am
you could move the heading into a user control and set it there
Contribute to the working anarchy we fondly call the Internet
Back to Top
CountAnton View Drop Down
Newbie
Newbie
Avatar

Joined: 18 February 2003
Location: United Kingdom
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote CountAnton Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2003 at 8:07am

Originally posted by MorningZ MorningZ wrote:

you could move the heading into a user control and set it there

Okay, thanks, I guess I will have to do it this way.  Was just wondering if their was a simple way like with other html elements.  Apparently MicroSoft have neglected the tags in the <head></head> in ASP.NET.

Do you know if there is an efficiency issue using some of the predefined controls compared to custom controls?  In other words are the predefined controls trying to do anything clever that impedes performance, that writing our own controls could improve?

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2003 at 8:14am
i'm not sure 100%.. but if i had to make an educated guess, i would say it wouldn't be much different since it all gets compiled anyways.... if there even was any difference, it wouldn't be noticible
Contribute to the working anarchy we fondly call the Internet
Back to Top
CountAnton View Drop Down
Newbie
Newbie
Avatar

Joined: 18 February 2003
Location: United Kingdom
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote CountAnton Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2003 at 8:29am

Originally posted by MorningZ MorningZ wrote:

i'm not sure 100%.. but if i had to make an educated guess, i would say it wouldn't be much different since it all gets compiled anyways.... if there even was any difference, it wouldn't be noticible

Okay, thanks.  Maybe one day they will add a standard control for manipulating tags within the head.  In the meantime I guess we all have to keep re-inventing the wheel...

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2003 at 2:11pm
maybe you can help me out the other direction....

where are you learning about code behind and stuff at? i am still hazy on using it and cannot find really good examples/explainations about it....

i think its more a matter of me thinking its so complex and hard, when it's really not, but some good code would be equivelent of dropping an anvil on my head to make me stop thinking its so complex, heh heh
Contribute to the working anarchy we fondly call the Internet
Back to Top
CountAnton View Drop Down
Newbie
Newbie
Avatar

Joined: 18 February 2003
Location: United Kingdom
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote CountAnton Quote  Post ReplyReply Direct Link To This Post Posted: 25 February 2003 at 8:14am

A basic code behind tutorial can be found at...

http://www.4guysfromrolla.com/webtech/100500-1.shtml

its not really much different than not doing it.  The only real differences being

a) that you need to put a directive at the top of the aspx page, telling it where its code is

b) in the code file you need to declare all the controls that you use

c) you cannot directly access html tags simply by giving them an id and a runat="server".  You have to create custom controls instead.

d) you precompile the code into a dll.  Visual Studio makes this last step pretty easy.  Not sure how you'd go about it from the command line, since it puts all the pages into a single dll with the name of your web project and I only have experience of compiling from a single source on the command line.

If I'm wrong about any of this I'd like to know...

Back to Top
niner911 View Drop Down
Newbie
Newbie


Joined: 26 February 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote niner911 Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2003 at 4:39pm

you can also just use the "literal" control for the <head></head> stuff. this is the approach i took on my wite.

 

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.