In article <11**********************@v46g2000cwv.googlegroups .com>,
sa*************@googlemail.com writes
of course it would worked if I added <head runat="server"> directely
in the page ! But I can't do it this way.
all the html markups from my project are coming from a database (from
<html> to <body>, including <head runat=server>)
therefore I have to use response.write to write this html dynamically
before the rest of the page.
You don't *have* to use Response.Write, see below.
Is this clear ?
It's clear, but it's going to cause you a big problem. To apply themes,
the ASP.NET engine needs to be able to parse the <head> tag of your
document at run time. If you are pulling this tag out of a database,
then it's not going to be available at run time, so you can't apply
theme.
Do you understand my probleme now ?
I do, do you understand now why it isn't working?
It sounds like you might need to rethink the way your data is stored.
Wouldn't you be better storing key information in the database and using
that as data for the tags, rather than storing the tags themselves?
For example, if you wanted to store a title for the page, instead of
saving the following in your database...
<head>
<title>my page</title>
</head>
you would be better storing just the text of the title ("my page" in
this case) and have server-side code like this...
<head>
<title><asp:Literal ID="litTitle" runat="server" /></title>
</head>
Then your page could extract the title from the database, and just set
the Text property of the literal to it. That sounds like a more sensible
system anyway, and would allow you to add the runat="server" attribute
to your <head> tag, allowing you to use themes.
Hope this helps
--
Alan Silver
(anything added below this line is nothing to do with me)