T
tshad
I am using asp.net 1.1 and am creating my pages with different looks where
the middle right is where my actual changing content will go.
It seems to work pretty well except for some strange behavior and this seems
to be caused from the placement of the my Panel objects. I am using Panels
as placeholders for my controls. I can't just put controls on the page as
registered objects as the objects will be different based on the companies
that are using them. So I load the control and add them to the panel. I
have been told this is the best way to do this.
The problem is that the Panels are changed to <Div ID="x">. Since my
controls are basically html code for the look, I end up with the </div> tag
inside a <td> statement. This is not legal and causes some issues.
What it looks like is something like:
<div "test">
<table>
<tr>
<td>
....
</div>
</td>
</tr>
</table>
The problem is that the opening <div> tag is outside the table and the
closing </div> tag is inside the table. If I wasn't using a placeholder
that changed to <div> there wouldn't be a problem.
Is there a way to have the Panel not create a <div> tag? Or a better way to
load the objects?
As you can see from the following, there is the basically the following
objects and html code:
1) Top of the page
2) Navigation menus
3) Form tag
4) Object that as all the textboxes, labels asp.net code etc.
5) Closing Form tag
6) Bottom of the page
I had also thought about just using one Panel and adding the controls into
that panel. Not sure how to do the Form part, however, unless I just create
2 controls 1 that has only the Form tag and one that has only the closing
form tag.
*****************************************
<%@ 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")
for i as integer = 0 to skinArray.Count - 1 step 3
if skinArray(i) = request("MID") then
session("CompanyInitials") = skinArray(i+1)
end if
Next
if session("CompanyInitials") = "sdhc" orElse session("CompanyInitials") =
"fts" orElse session("CompanyInitials") = "mazda" then
pageTop = "/skins/" & session("CompanyInitials") & "/" &
session("CompanyInitials") & "PageTop" & ".ascx"
navigateTop = "/skins/" & session("CompanyInitials") & "/" &
session("CompanyInitials") & "NavigateTop" + ".ascx"
pageBottom = "/skins/" & session("CompanyInitials") & "/" &
session("CompanyInitials") & "PageBottom" + ".ascx"
end if
pageTopControl = LoadControl(pageTop)
PageTopPanel.Controls.Add(pageTopControl)
navigateTopControl = LoadControl(navigateTop)
NavigateTopPanel.Controls.Add(navigateTopControl)
LogonControl = LoadControl("/applicant/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">
<aspanel ID="PageTopPanel" runat="server"/>
<aspanel ID="NavigateTopPanel" runat="server"/>
<form id="addForm" runat="server">
<aspanel ID="LogonPanel" runat="server"/>
</form>
<aspanel ID="PageBottomPanel" runat="server"/>
<asp:label CSSClass="UserHeaderLabel" visible=false id="UserLoggedOnLabel"
text="Hello: " runat="server"/>
<asp:label CSSClass="UserHeader" visible=false id="UserLoggedOn"
runat="server"/></body>
</html>
******************************************
Thanks,
Tom
the middle right is where my actual changing content will go.
It seems to work pretty well except for some strange behavior and this seems
to be caused from the placement of the my Panel objects. I am using Panels
as placeholders for my controls. I can't just put controls on the page as
registered objects as the objects will be different based on the companies
that are using them. So I load the control and add them to the panel. I
have been told this is the best way to do this.
The problem is that the Panels are changed to <Div ID="x">. Since my
controls are basically html code for the look, I end up with the </div> tag
inside a <td> statement. This is not legal and causes some issues.
What it looks like is something like:
<div "test">
<table>
<tr>
<td>
....
</div>
</td>
</tr>
</table>
The problem is that the opening <div> tag is outside the table and the
closing </div> tag is inside the table. If I wasn't using a placeholder
that changed to <div> there wouldn't be a problem.
Is there a way to have the Panel not create a <div> tag? Or a better way to
load the objects?
As you can see from the following, there is the basically the following
objects and html code:
1) Top of the page
2) Navigation menus
3) Form tag
4) Object that as all the textboxes, labels asp.net code etc.
5) Closing Form tag
6) Bottom of the page
I had also thought about just using one Panel and adding the controls into
that panel. Not sure how to do the Form part, however, unless I just create
2 controls 1 that has only the Form tag and one that has only the closing
form tag.
*****************************************
<%@ 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")
for i as integer = 0 to skinArray.Count - 1 step 3
if skinArray(i) = request("MID") then
session("CompanyInitials") = skinArray(i+1)
end if
Next
if session("CompanyInitials") = "sdhc" orElse session("CompanyInitials") =
"fts" orElse session("CompanyInitials") = "mazda" then
pageTop = "/skins/" & session("CompanyInitials") & "/" &
session("CompanyInitials") & "PageTop" & ".ascx"
navigateTop = "/skins/" & session("CompanyInitials") & "/" &
session("CompanyInitials") & "NavigateTop" + ".ascx"
pageBottom = "/skins/" & session("CompanyInitials") & "/" &
session("CompanyInitials") & "PageBottom" + ".ascx"
end if
pageTopControl = LoadControl(pageTop)
PageTopPanel.Controls.Add(pageTopControl)
navigateTopControl = LoadControl(navigateTop)
NavigateTopPanel.Controls.Add(navigateTopControl)
LogonControl = LoadControl("/applicant/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">
<aspanel ID="PageTopPanel" runat="server"/>
<aspanel ID="NavigateTopPanel" runat="server"/>
<form id="addForm" runat="server">
<aspanel ID="LogonPanel" runat="server"/>
</form>
<aspanel ID="PageBottomPanel" runat="server"/>
<asp:label CSSClass="UserHeaderLabel" visible=false id="UserLoggedOnLabel"
text="Hello: " runat="server"/>
<asp:label CSSClass="UserHeader" visible=false id="UserLoggedOn"
runat="server"/></body>
</html>
******************************************
Thanks,
Tom