Using ascx pages as header and footer includes causing problems

Using ascx pages as header and footer includes causing problems

I was using 2 ascx pages as a h eader and footer include effect much like I used to do in classic asp.  This was working fine but now VS 2005 complains about it...whereas VS 2003 didn't.  Now, when I compile, I get a string of errors saying I'm missing html tags but a lot of those starting or ending tags are in the header.ascx or footer.ascx

my aspx
----------------------------------------------------------

<%@ Register TagPrefix="HD" TagName="HEADER_JS" Src="header_javascript.ascx" %>
<%@ Register TagPrefix="HD" TagName="HEADER" Src="header.ascx" %>
<%@ Register TagPrefix="FT" TagName="FOOTER" Src="footer.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="catering_form.aspx.vb" Inherits="elbalazo.catering_form" %>
<%@ Register TagPrefix="cc1" Namespace="CalendarControl" Assembly="Calendar" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.0 transitional//EN">
<html>
 <head>
  <title>EL BALAZO - Catering Order Form</title>
 </head>
  <HD:HEADER id="header1" runat="server"></HD:HEADER>
 <td style="padding-right: 10px; padding-left: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px"
  height="47" background="/images/right_back.gif" valign="top"><!-- TOP RIGHT HEADER PIC -->
  <table borderColor="green" cellSpacing="0" cellPadding="0" width="320" border="0">
   <tr>
    <td>
     <table borderColor="green" cellSpacing="0" cellPadding="0" width="390" border="0">
      <!-- TOP RIGHT CONTENT --></table>
    </td>
   </tr>
  </table>
 </td>
 </tr><tr class="screen">
  <td style="padding-right: 40px; padding-left: 15px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px"
   background="/images/right_back.gif" valign="top" width="438" rowspan="5"></td>
 </tr>
 </table>



my header.ascx for example has this:
----------------------------------------------------------

<%@ Control Language="vb" AutoEventWireup="false" Codebehind="header.ascx.vb" Inherits="elbalazo.WebUserControl1" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>


<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" onLoad="MM_preloadImages('images/inside_o_04.jpg','images/inside_o_07.jpg','images/inside_o_08.jpg','images/inside_o_09.jpg','images/inside_o_10.jpg','images/inside_o_11.jpg')">

<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%" class="bg">&nbsp;</td>
    <td>
      <table id="Table_01" width="950" border="0" cellpadding="0" bordercolor="yellow" cellspacing="0">
      <tr class="screen">
        <td height="121" colspan="6" class="screen"><img src="images/index_01.jpg" width="330" height="121"><img src="images/sub2_02.jpg" width="332" height="121"><img src="images/sub2_03.jpg" width="288" height="121"></td>
      </tr>
      <tr>
        <td width="102" valign="top" class="white_bg"><img src="images/sub2_04.jpg" width="102" height="281" border="0" usemap="#Map" class="screen"><br>
          <img src="images/sub2_07.jpg" width="102" height="385" class="screen"><br>
          <p>&nbsp;</p></td>
        <td colspan="4">
       
          <table width="758" border="0" cellpadding="0" cellspacing="0" bgcolor="#153764" bordercolor="red" id="Table_02">

          <tr class="screen">
            <td colspan="3"><img src="images/inside_01.jpg" width="320" height="138" alt=""></td>
            <td bgcolor="#FFFFFF"><img src="images/inside_02_new.jpg" width="437" height="138" alt=""></td>
          </tr>
          <tr>
            <td rowspan="7" valign="top" background="images/left_back.gif" bgcolor="#FFFDDA" class="screen"><img src="images/back_03.jpg" width="129" height="211" alt=""></td>
            <td rowspan="7" valign="top" bgcolor="#FFFDDA" class="screen"><a href="history.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image17','','images/inside_04_over.jpg',1)"><img src="/review/images/inside_04_new.jpg" name="Image17" width="126" height="34" border="0"></a><br>
            <a href="menu.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image18','','images/inside_07_over.jpg',1)"><img src="/review/images/inside_07_new.jpg" name="Image18" width="126" height="22" border="0"><br></a>
             <a href="catering.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image19','','images/inside_08_over.jpg',1)"><img src="/review/images/inside_08_new.jpg" name="Image19" width="126" height="21" border="0"><br></a>
             <a href="locations.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image20','','images/inside_09_over.jpg',1)"><img src="/review/images/inside_09_new.jpg" name="Image20" width="126" height="21" border="0"><br></a>
             <a href="gift.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','/review/images/inside_12_over.jpg',1)"><img src="/review/images/inside_12_new.jpg" name="Image21" width="126" height="21" border="0"><br></a>
             <a href="rewards.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image22','','/review/images/inside_13_over.jpg',1)"><img src="/review/images/inside_13_new.jpg" name="Image22" width="126" height="20" border="0"><br></a>
             <a href="gift.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image23','','/review/images/inside_10_over.jpg',1)"><img src="/review/images/inside_10_new.jpg" name="Image23" width="126" height="22" border="0"><br></a>
             <a href="contact.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image24','','/review/images/inside_11_over.jpg',1)"><img src="/review/images/inside_11_new.jpg" name="Image24" width="126" height="30" border="0"></a><br><img src="images/back_13.jpg" width="126" height="20" alt=""></td>
            <td rowspan="7" valign="top" bgcolor="#FFFDDA" class="screen"><img src="images/back_05.jpg" width="65" height="211" alt=""></td>
         </div>
LVL 1
dba123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

marchianoCommented:
do you have your </body> and </html> in footer.ascx?
can I see it?
0
dba123Author Commented:
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="footer.ascx.vb" Inherits="elbalazo.WebUserControl2" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
            <tr class="screen">
              <td height="34"><img src="images/back_17.jpg" width="320" height="34" alt=""><img src="images/back_18.jpg" width="438" height="34"></td>
            </tr>
          </table></td>
        <td width="90" rowspan="2" valign="top"><img src="images/sub2_06.jpg" width="90" height="281" class="screen"><br>
          <img src="images/sub2_08.jpg" width="90" height="385"> </td>
        </tr>
      <tr class="screen">
        <td width="102" align="right" valign="top"><img src="images/white.gif" width="9" height="7"></td>
        <td height="100%" colspan="4"><img src="images/footer.gif" width="758" height="40"><div id="Layer1" style="position:relative; left:645px; top:-155px; width:158px; height:201px; z-index:1"><img src="images/cactus.gif" width="158" height="201"></div>
          </td>
        </tr>
      <tr class="screen">
        <td><img src="images/spacer.gif" width="102" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="228" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="152" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="180" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="198" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="90" height="1" alt=""></td>
        <td></td>
      </tr>
    </table></td>
    <td width="50%" class="bg">&nbsp;</td>
  </tr>
</table>
<map name="Map">
  <area shape="rect" coords="75,132,102,216" href="index.asp">
</map>
<map name="locations_address_map_danville">
<area shape="rect" alt="" coords="150,4,206,19" href="http://www.google.com/maps?spn=0.151393,0.290279&saddr=&daddr=1900+San+Ramon+Valley+Blvd,+San+Ramon,+CA+94583&hl=en">
</MAP>
<script language="JavaScript" type="text/javascript" src="wz_tooltip.js"></script>

</div>
</body>
</html>
0
marchianoCommented:
what exactly does the error message look like?

because two of your ascx and aspx are working fine at my computer.

0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

dba123Author Commented:
yea, they were working fine in VS 2003 until I opened them in VS 2005 and allowed the Web Application Project Conversion in VS 2005
0
dba123Author Commented:
here are a few of the messages

Error      1      Validation (Internet Explorer 6): Element 'body' is missing its closing tag.      C:\Inetpub\wwwroot\elbalazo\header.ascx      4      2      elbalazo
Error      2      Validation (Internet Explorer 6): Element 'table' is missing its closing tag.      C:\Inetpub\wwwroot\elbalazo\header.ascx      6      2      elbalazo
Error      3      Validation (Internet Explorer 6): Element 'table' is missing its closing tag.      C:\Inetpub\wwwroot\elbalazo\header.ascx      10      8      elbalazo
0
dba123Author Commented:
so it's actually looking at the ascx as incomplete....which is how it's supposed to be, it is a header!  I'm not sure why VS 2005 has such a problem wtih something that was working just fine in VS 2003!  I know they made a lot of changes in VS 2005 such as strict HTML rules but the ascx should still be referencing correctly but seems not to be in my aspx
0
marchianoCommented:
it will work if you put your <body>, </body> in the same file.
<html> and </html> also in the same file.
<table> and </table> also in the same file.

i think, asp.net 2 will check opening and closing tag in each file.
so can't seperate them into two different file.

0
marchianoCommented:
it is a little bit of work, though.
you will need to re-structure your page.
0
dba123Author Commented:
so you're saying what, put the <html>, <body>, and <table> tags in my main page and the rest in the ascx...let me try..
0
dba123Author Commented:
no, none of this is it.  Even when I put those tags in my main aspx, it still complaines about a missing starting <tr> which is in my header.ascx
0
dba123Author Commented:
then how if I cannot separate them, can I manage a header and footer like I did in classic asp as include files...so that I don't have to edit every page when changes are needed to the header or footer across all my pages?
0
dba123Author Commented:
I also noticed that if I fix something, the errors in the complier don't go away until I choose the design button
0
marchianoCommented:
yeah,.. what I found just now is that most of your html tag is not well structured.
for example,
1. there are missing </div>, </td>
2. <tr></tr> inside <td> tag for example:

                                                               <tr class="screen">
                                                      <td height="34">
                                                            <img src="images/back_17.jpg" width="320" height="34" alt="">
                                                                  <img src="images/back_18.jpg" width="438" height="34">
                                                      </td>
                                                </tr>

so i guess,.. we will need to fix those minor errors


0
dba123Author Commented:
<tr> is inside <td> because <td> contains many nested tables...so it looks like it is but really it's probably  nested within a table inside the <td>
0
marchianoCommented:
you cant do:

<td>
  <tr></tr>
</td>

but, you can do:
<td>
  <table>
    <tr></tr>
  </table>
</td>

I would be able to help you, if you can send all the images to me.
0
dba123Author Commented:
I just need to use ASP.NET 2.0 Master pages for my header and footer, that's it!
0
dba123Author Commented:
forget the ascx as header and footer, that's just not the way to go now that .NET 2.0 is out with master pages
0
GranModCommented:
Closed, 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.