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
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
1,477 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
1 Comment
 
LVL 6

Accepted Solution

by:
ventaur earned 500 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 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