?
Solved

unable to place content place holder in table in an asp.net master page using vb.net 2005

Posted on 2007-11-17
1
Medium Priority
?
1,485 Views
Last Modified: 2013-11-26
Hi,

I am creating a master page in asp.net using vb.net 2005 studio. When the content place holder is outside the table there is no errors. coseL -

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left">&nbsp;</td>
    <td width="100%"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="70"><img src="images/logo.jpg" alt="654" width="350" height="120" /></td>
      </tr>
      <tr>
        <td background="images/bg9.gif" height="32">&nbsp;</td>
      </tr>
      <tr>
        <td background="images/f3.gif" height="33">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td background="images/bg1.gif" height="19">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td><img src="images/head1.gif" alt="te4" width="193" height="37" /><br />
        <table width="193" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="images/bg8.gif" align="center"><table border="0" cellpadding="5" cellspacing="0" background="">
                <form>
                  <tr align="left">
                    <td width="151"><b>Login</b><br />                    </td>
                  </tr>
                  <tr align="left">
                    <td align="left"><b>Password</b><br />
                        <input type="image" src="images/b_sign.gif" align="left" width="79" height="25" border="0" />
                        <br /></td>
                  </tr>
                </form>
            </table></td>
          </tr>
        </table>
      <img src="images/tr2.gif" alt="645" width="193" height="7" /><br />
        <br />
        <img src="images/head4.gif" alt="6456" width="193" height="36" /><br />
        <table width="193" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="images/bg8.gif" align="center">&nbsp;</td>
          </tr>
        </table>
      <img src="images/tr2.gif" alt="645" width="193" height="7" /><br />
        <br />    </td>
    <td>&nbsp;</td>
    <td background="images/bg3.gif"><br /></td>
    <td width="100%"><div align="center">
      <div align="center"></div>
      </div></td>
    <td background="images/bg4.gif">&nbsp;</td>
    <td background="images/bg4.gif">&nbsp;</td>
    <td><img src="images/head3.gif" alt="ty54y4" width="193" height="37" /><br />
        <table width="193" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="images/bg6.gif"><table width="193" border="0" cellpadding="0" cellspacing="0" background="">
                <tr valign="top" align="left">
                  <td colspan="3"><br />
                      <br /></td>
                </tr>
            </table></td>
          </tr>
        </table>
      <img src="images/tr5.gif" alt="64" width="193" height="14" /><br />
        <br />    </td>
  </tr>
</table>
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
    </div>
    </form>
</body>
</html>



'*************************************************************************************************************

When I place it into a table cell it comes up with multiple errors saying: -

Error      1      Cannot switch views: This end tag has no matching start tag.      C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\befilesmart.com\MasterPage.master      70      13      C:\...\befilesmart.com\

Error      6      Validation (XHTML 1.0 Transitional): Attribute 'background' is not a valid attribute of element 'td'.      C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\befilesmart.com\MasterPage.master      20      13      C:\...\befilesmart.com\

Error      24      Validation (XHTML 1.0 Transitional): Attribute 'border' is not a valid attribute of element 'input'.      C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\befilesmart.com\MasterPage.master      45      105      C:\...\befilesmart.com\

There are many more but these are a few. The code I am using that produces the errors are: -

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left">&nbsp;</td>
    <td width="100%"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="70"><img src="images/logo.jpg" alt="654" width="350" height="120" /></td>
      </tr>
      <tr>
        <td background="images/bg9.gif" height="32">&nbsp;</td>
      </tr>
      <tr>
        <td background="images/f3.gif" height="33">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td background="images/bg1.gif" height="19">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td><img src="images/head1.gif" alt="te4" width="193" height="37" /><br />
        <table width="193" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="images/bg8.gif" align="center"><table border="0" cellpadding="5" cellspacing="0" background="">
                <form>
                  <tr align="left">
                    <td width="151"><b>Login</b><br />                    </td>
                  </tr>
                  <tr align="left">
                    <td align="left"><b>Password</b><br />
                        <input type="image" src="images/b_sign.gif" align="left" width="79" height="25" border="0" />
                        <br /></td>
                  </tr>
                </form>
            </table></td>
          </tr>
        </table>
      <img src="images/tr2.gif" alt="645" width="193" height="7" /><br />
        <br />
        <img src="images/head4.gif" alt="6456" width="193" height="36" /><br />
        <table width="193" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="images/bg8.gif" align="center">&nbsp;</td>
          </tr>
        </table>
      <img src="images/tr2.gif" alt="645" width="193" height="7" /><br />
        <br />    </td>
    <td>&nbsp;</td>
    <td background="images/bg3.gif"><br /></td>
    <td width="100%"><div align="center">
      <div align="center">
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
    </div>
    </div>
      </div></td>
    <td background="images/bg4.gif">&nbsp;</td>
    <td background="images/bg4.gif">&nbsp;</td>
    <td><img src="images/head3.gif" alt="ty54y4" width="193" height="37" /><br />
        <table width="193" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="images/bg6.gif"><table width="193" border="0" cellpadding="0" cellspacing="0" background="">
                <tr valign="top" align="left">
                  <td colspan="3"><br />
                      <br /></td>
                </tr>
            </table></td>
          </tr>
        </table>
      <img src="images/tr5.gif" alt="64" width="193" height="14" /><br />
        <br />    </td>
  </tr>
</table>
    </form>
</body>
</html>


What am I doing wrong please?

Many thanks
Lee

'*************************************************************************************************************

0
Comment
Question by:ljhodgett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
ventaur earned 2000 total points
ID: 20304555
Hello.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Since you are using XHTML for your page, many style/format attributes are no longer acceptable (i.e., background, border, etc.). Check out this article on the differences between XHTML and HTML.

http://www.w3schools.com/xhtml/xhtml_html.asp


However, the first error relates to an extra end tag near your place holder. I've included the problem area below. Count the number of starting "div" tags, then count the number of ending "div" tags. There is one too many ending tags. Remove that last "</div>' tag and you'll be able to switch to design view just fine.
 <td width="100%"><div align="center">
      <div align="center">
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
    </div>
    </div>
      </div></td>

Open in new window

0

Featured Post

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question