473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

get head by tagname (from server control)

my server control generates part of page from codebehind. I get other part
from different source.
how can i get <head></head> (written inline on .aspx) from the
ControlCollection(.aspx.vb)? For example - i would like to insert metatags.

it looks getting it by ID(which i don't have) is the only possibillity (i
don't want to override rendering )
any idea(getting it by TagName maybe)?

thnx
Nov 17 '05 #1
3 1431
If you add the runat='server' attribute to the header tags then you can
access them from your code behind.
Here's more info and a good example using the Title tag:
http://www.aspalliance.com/kenc/faq5.aspx

Another option would be to turn the whole header section into a user
control. This gives you ultimate flexibility. Then you can output whatever
you want wherever you want within the header.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Peter Licen" <pe*********@nps.si> wrote in message
news:eX****************@TK2MSFTNGP10.phx.gbl...
my server control generates part of page from codebehind. I get other part from different source.
how can i get <head></head> (written inline on .aspx) from the
ControlCollection(.aspx.vb)? For example - i would like to insert metatags.
it looks getting it by ID(which i don't have) is the only possibillity (i
don't want to override rendering )
any idea(getting it by TagName maybe)?

thnx

Nov 17 '05 #2
thnx, but the problem is that i don't write the inline tags. I get them and
i have first to analyze them and, if nessesary, correct them.
otherways, attribute id is the best choise(it has all support from
codebehind)

sorry for the direct replay

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:O8****************@TK2MSFTNGP12.phx.gbl...
If you add the runat='server' attribute to the header tags then you can
access them from your code behind.
Here's more info and a good example using the Title tag:
http://www.aspalliance.com/kenc/faq5.aspx

Another option would be to turn the whole header section into a user
control. This gives you ultimate flexibility. Then you can output whatever you want wherever you want within the header.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Peter Licen" <pe*********@nps.si> wrote in message
news:eX****************@TK2MSFTNGP10.phx.gbl...
my server control generates part of page from codebehind. I get other

part
from different source.
how can i get <head></head> (written inline on .aspx) from the
ControlCollection(.aspx.vb)? For example - i would like to insert

metatags.

it looks getting it by ID(which i don't have) is the only possibillity (i don't want to override rendering )
any idea(getting it by TagName maybe)?

thnx


Nov 17 '05 #3
Well then that boosts the second idea I mentioned, which is to make the
whole section a user (or custom) control. Then you can render whatever you
want.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Peter Ličen" <pe*********@nps.si> wrote in message
news:ex****************@TK2MSFTNGP10.phx.gbl...
thnx, but the problem is that i don't write the inline tags. I get them and i have first to analyze them and, if nessesary, correct them.
otherways, attribute id is the best choise(it has all support from
codebehind)

sorry for the direct replay

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:O8****************@TK2MSFTNGP12.phx.gbl...
If you add the runat='server' attribute to the header tags then you can
access them from your code behind.
Here's more info and a good example using the Title tag:
http://www.aspalliance.com/kenc/faq5.aspx

Another option would be to turn the whole header section into a user
control. This gives you ultimate flexibility. Then you can output

whatever
you want wherever you want within the header.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Peter Licen" <pe*********@nps.si> wrote in message
news:eX****************@TK2MSFTNGP10.phx.gbl...
my server control generates part of page from codebehind. I get other

part
from different source.
how can i get <head></head> (written inline on .aspx) from the
ControlCollection(.aspx.vb)? For example - i would like to insert

metatags.

it looks getting it by ID(which i don't have) is the only possibillity (i don't want to override rendering )
any idea(getting it by TagName maybe)?

thnx



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Brian W | last post by:
Hi All, I have a web user control that, among other things, provides Print this page, and Email this page functionality I have this script that is to execute on the click of the asp:hyperlinks ...
7
by: | last post by:
What is the beat way to dynamically write/add to the HEAD tag of an ASPX page (the <head runat=server ... is too error prone and not very repeatable)? Thanks.
6
by: Ken Varn | last post by:
I want to add my own custom <STYLE> section in the <HEAD> section of my ASP.NET page within a custom control. Can someone tell me how I can have my custom control add tags to the <HEAD> section of...
3
by: Sam Samnah | last post by:
Ok I have a bit of a problem with a Server control I am building. I need to write a client-side Javascript block between the open and closing Head tag. I have tried the following methods: first...
3
by: thomasamillergoogle | last post by:
Is it possible that my user control can add code to the HEAD of the parent page that hosts the control?
3
by: PJ6 | last post by:
I want to render this text into the <HEAD> section of a page (and perhaps mute any existing title declaration, or alter it to be this instead) - <title runat="server" id=HtmlTitle></title> It...
2
by: Frank | last post by:
From: "Frank" <fkaesser@pfmail.com> Subject: Can I Use HTML Text Writer i a Custom Control to Render the <head> Section? Date: Wednesday, January 18, 2006 11:38 AM I would like to create a...
3
by: Rick | last post by:
I have a base class that inherits from System.Web.UI.Page that I need to include the ability to read the inheriting class/page meta tags. I can't find any methods in the System.Web.UI.Page members...
19
by: Scott M. | last post by:
Why do we need runat="server" on our <headtags?
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.