By Stefan Holmberg on January 10th, 2007
In this page we are using two controls (just to show you it’s possible).
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="page2.aspx.cs" Inherits="page2" Title="Untitled Page" %>
<%@ Register TagPrefix="headermanager" Namespace="ASPCodeHeaderManager" Assembly="ASPCodeHeaderManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<headermanager:ASPCodeHeader ID="whatever" runat="server">
<includeScripts>
<headermanager:IncludeScript Path="~/scripts/hello.js" />
<headermanager:IncludeScript Path="~/scripts/world.js" />
</includeScripts>
<includeStylesheets>
<headermanager:Stylesheet Path="~/css/sheet2.css" />
</includeStylesheets>
<scriptsInHeader>
<headermanager:GlobalScriptArea>
function world123()
{
}
</headermanager:GlobalScriptArea>
</scriptsInHeader>
</headermanager:ASPCodeHeader>
<h1>this one includes the javascripts hello.js and world.js </h1>
<br />
<br />
Test hello to click <a [...]
By Stefan Holmberg on January 10th, 2007
Now lets look at page1.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="page1.aspx.cs" Inherits="page1" Title="Page 1" %>
<%@ Register TagPrefix="headermanager" Namespace="ASPCodeHeaderManager" Assembly="ASPCodeHeaderManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<headermanager:ASPCodeHeader ID="whatever" runat="server">
<includeScripts>
<headermanager:IncludeScript Path="~/scripts/hello.js" />
</includeScripts>
<metaData>
<headermanager:MetaData Name="keywords" Content="hello, there" />
</metaData>
<includeStylesheets>
<headermanager:Stylesheet Path="~/css/sheet1.css" />
</includeStylesheets>
<scriptsInHeader>
<headermanager:GlobalScriptArea Id="kk">
document.write('<' + 'style type="text/css">.tabber{display:none;}<\/style>');
</headermanager:GlobalScriptArea>
</scriptsInHeader>
</headermanager:ASPCodeHeader>
<h1>This one includes the javascript hello.js</h1>
Test to click <a href="javascript:Hello();">here</a>
</asp:Content>
As you can see we define the [...]
By Stefan Holmberg on January 10th, 2007
This example is what you get in the download. I will try to guide you though it so you get an understanding of the control.
We have a master page – master.master – and two pages (page1.aspx and page2.aspx).
Now – lets start with master.master:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" EnableViewState="false" %>
<%@ Register TagPrefix="headermanager" Namespace="ASPCodeHeaderManager" Assembly="ASPCodeHeaderManager" %>
<!DOCTYPE [...]