Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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,491 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

609 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