Re: no reference to object
So why not just add runat="server" in the <head> tag?
<head runat="server" id="PageHead">
Re: no reference to object
Quote:
Originally Posted by mendhak
So why not just add runat="server" in the <head> tag?
<head runat="server" id="PageHead">
Because if I do that the javascript I have on the page does not run. I tried moving the javascript out of the <head> and into the <body> but still does not run. This page also has Ajax controls on it. I'm beginning to think they cause problems.
What is particularly weird is that loads of pages on the site run quite happily with the usual stylesheet link in the head. The only ones that ask for runat="server" in the head tag are the ones that use the Ajax Toolkit.
Re: no reference to object
Question: Are you using themes? Even a default one? If yes, put your CSS in the default theme folder.
As for the requirement by the ajax toolkit, this is most likely because the ajax code needs to dynamically inject <script> tags into the head section, hence the runat="server" needed.
You mentioned that if you add the runat="server" your javascript stops running. (Why do you get all the weird situations?) Could you instead then attempt to use code similar to post 1 to add your javascript? Or, if it's in-page javascript code, use Page.RegisterClientScriptBlock