How to modify <head> tag when using a master page?

Tech-Archive recommends: Fix windows errors by optimizing your registry



I am creating a web app using asp.net 2.0 where all pages are based a
single master page. On some of the aspx pages I need to add javascript
to the head tag in order to use Google maps.

I tried this to access the header:

In the master page:
<HEAD runat="server">

In the aspx page: Page_Load

HtmlHead head = (System.Web.UI.HtmlControls.HtmlHead)Header;

i get this error:

"Cannot get inner content of because the contents are not literal"

Is there a way to programatically add to the head tag from within an
aspx page when using master pages?

.



Relevant Pages

  • Re: Master Pages - loading of ContentPlaceHolder
    ... news store from the center section or the quick menu on the right side of the ... Here is the layout of the master page (open window until you have three ... The reason we don't want to have different .aspx pages calling the same ... You setup a .master file with ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: How to modify tag when using a master page?
    ... You have to give the head tag an id, and associate it with a declared ... Microsoft MVP ... > single master page. ... On some of the aspx pages I need to add javascript ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem calling function
    ... I have an aspx page that uses a master page. ... added a reference to a javascript file. ... javascript file, I keep getting error that function is undefined. ...
    (comp.lang.javascript)
  • Re: How to reference the masterpage body element in server code
    ... demonstrate how to access a control on a master page from the content page: ... "Roberto Kohler" wrote: ... > handler from an aspx file that uses the master-page. ... I could choose to set the onkeydown event handler to null from ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Making a public property in a master page is not visible in .aspx page
    ... I have a .aspx page that has a master page. ... In the master page, I have a Literal Control, and I created a public ... or methos via "Master.Method" etc. ...
    (microsoft.public.dotnet.languages.csharp)