get head by tagname (from server control)

  • Thread starter Thread starter Peter Licen
  • Start date Start date
P

Peter Licen

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
 
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.
 
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
 
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.
 
Back
Top