T
tshad
I am using asp.net 1.1 and am creating my pages with different looks and
using controls for each part of the page (top, bottom, navigation etc)
The way I have it set up is the following where I have 4 different controls
(one for each page part). I am looking at a couple other ways of doing this
as well and was wondering if there is a drawback to doing the others.
*****************************************
<%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
Dim pageTop as String
Dim navigateTop as String
Dim pageBottom as String
Dim pageTopControl as Control
Dim navigateTopControl as Control
Dim pageBottomControl as Control
Dim LogonControl as Control
Dim skinArray as ArrayList = Application("SkinArray")
pageTop = "PageTop.ascx"
navigateTop = "NavigateTop.ascx"
pageBottom = "PageBottom.ascx"
pageTopControl = LoadControl(pageTop)
PageTopPanel.Controls.Add(pageTopControl)
navigateTopControl = LoadControl(navigateTop)
NavigateTopPanel.Controls.Add(navigateTopControl)
LogonControl = LoadControl("DisplayCompanyJobs.ascx")
LogonPanel.Controls.Add(LogonControl)
pageBottomControl = LoadControl(pageBottom)
PageBottomPanel.Controls.Add(pageBottomControl)
end Sub
</script>
<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body id="myBody" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0" runat="server">
<form id="addForm" runat="server">
<asplaceHolder ID="PageTopPanel" runat="server"/>
<asplaceHolder ID="NavigateTopPanel" runat="server"/>
<asplaceHolder ID="LogonPanel" runat="server"/>
<asplaceHolder ID="PageBottomPanel" runat="server"/>
</form>
</body>
</html>
******************************************
Another way is to have only one Placeholder and load them one by one. Not
sure if this would have any performance impact or not. I am still loading 4
pages. Would the controls always display in the order they are loaded into
the PlaceHolder?
*****************************************
<%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
Dim pageTop as String
Dim navigateTop as String
Dim pageBottom as String
Dim pageTopControl as Control
Dim navigateTopControl as Control
Dim pageBottomControl as Control
Dim LogonControl as Control
Dim skinArray as ArrayList = Application("SkinArray")
pageTop = "PageTop.ascx"
navigateTop = "NavigateTop.ascx"
pageBottom = "PageBottom.ascx"
pageTopControl = LoadControl(pageTop)
thePlaceHolder.Controls.Add(pageTopControl)
navigateTopControl = LoadControl(navigateTop)
thePlaceHolder.Controls.Add(navigateTopControl)
LogonControl = LoadControl("DisplayCompanyJobs.ascx")
thePlaceHolder.Controls.Add(LogonControl)
pageBottomControl = LoadControl(pageBottom)
thePlaceHolder.Controls.Add(pageBottomControl)
end Sub
</script>
<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body id="myBody" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0" runat="server">
<form id="addForm" runat="server">
<asplaceHolder ID="thePlaceHolder" runat="server"/>
</form>
</body>
</html>
******************************************
The other way is to just build the whole page and have that page as a
control and have it just load the content section as a control
(DisplayCompanyJobs.ascx in my example).
Not sure if I would be saving a lot here as I am still loading a couple of
pages.
Thanks,
Tom
using controls for each part of the page (top, bottom, navigation etc)
The way I have it set up is the following where I have 4 different controls
(one for each page part). I am looking at a couple other ways of doing this
as well and was wondering if there is a drawback to doing the others.
*****************************************
<%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
Dim pageTop as String
Dim navigateTop as String
Dim pageBottom as String
Dim pageTopControl as Control
Dim navigateTopControl as Control
Dim pageBottomControl as Control
Dim LogonControl as Control
Dim skinArray as ArrayList = Application("SkinArray")
pageTop = "PageTop.ascx"
navigateTop = "NavigateTop.ascx"
pageBottom = "PageBottom.ascx"
pageTopControl = LoadControl(pageTop)
PageTopPanel.Controls.Add(pageTopControl)
navigateTopControl = LoadControl(navigateTop)
NavigateTopPanel.Controls.Add(navigateTopControl)
LogonControl = LoadControl("DisplayCompanyJobs.ascx")
LogonPanel.Controls.Add(LogonControl)
pageBottomControl = LoadControl(pageBottom)
PageBottomPanel.Controls.Add(pageBottomControl)
end Sub
</script>
<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body id="myBody" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0" runat="server">
<form id="addForm" runat="server">
<asplaceHolder ID="PageTopPanel" runat="server"/>
<asplaceHolder ID="NavigateTopPanel" runat="server"/>
<asplaceHolder ID="LogonPanel" runat="server"/>
<asplaceHolder ID="PageBottomPanel" runat="server"/>
</form>
</body>
</html>
******************************************
Another way is to have only one Placeholder and load them one by one. Not
sure if this would have any performance impact or not. I am still loading 4
pages. Would the controls always display in the order they are loaded into
the PlaceHolder?
*****************************************
<%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
Dim pageTop as String
Dim navigateTop as String
Dim pageBottom as String
Dim pageTopControl as Control
Dim navigateTopControl as Control
Dim pageBottomControl as Control
Dim LogonControl as Control
Dim skinArray as ArrayList = Application("SkinArray")
pageTop = "PageTop.ascx"
navigateTop = "NavigateTop.ascx"
pageBottom = "PageBottom.ascx"
pageTopControl = LoadControl(pageTop)
thePlaceHolder.Controls.Add(pageTopControl)
navigateTopControl = LoadControl(navigateTop)
thePlaceHolder.Controls.Add(navigateTopControl)
LogonControl = LoadControl("DisplayCompanyJobs.ascx")
thePlaceHolder.Controls.Add(LogonControl)
pageBottomControl = LoadControl(pageBottom)
thePlaceHolder.Controls.Add(pageBottomControl)
end Sub
</script>
<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body id="myBody" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0" runat="server">
<form id="addForm" runat="server">
<asplaceHolder ID="thePlaceHolder" runat="server"/>
</form>
</body>
</html>
******************************************
The other way is to just build the whole page and have that page as a
control and have it just load the content section as a control
(DisplayCompanyJobs.ascx in my example).
Not sure if I would be saving a lot here as I am still loading a couple of
pages.
Thanks,
Tom