Master Page Content Place Holder Changes Shape

Last post 08-30-2007 3:00 AM by Johnson2007. 1 replies.

Sort Posts:

  • Master Page Content Place Holder Changes Shape

    08-28-2007, 1:57 AM
    • Member
      19 point Member
    • SidC
    • Member since 06-18-2007, 4:49 PM
    • Visalia CA
    • Posts 61

    Good Evening,

    I'm very new to ASP.net, as the following masterpage code might depict.  I'm trying to design a master page with one content place holder.  The master page is coming together fairly well except for the menu control, that needs more work.  When I copy text into the content control in default.aspx and view the page in browser, the content place holder becomes very narrow and doesn't stretch across the entire table cell. 

    Could someone suggest some ideas as to how I might modify my master page so that the content place holder doesn't lose its shape when text is pasted into the content control on the content pages?  I greatly appreciate your help.

    Thanks,

    SidC 

     

    <%@ 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>MasterPage</title>

    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />

    </head>

    <body style="font-size: 10pt; color: white; font-family: Tahoma" bgcolor="#7e90a7" alink="#ffffff" link="#ffffff" text="#ffffff" vlink="#66ccff">

    <form id="form1" runat="server">

    <div>

    <table>

    <tr>

    <td colspan="2" style="height: 236px">

    &nbsp;<asp:Image ID="Image1" runat="server" ImageAlign="Top" ImageUrl="~/Images/topF.jpg"

    Width="980px" /></td>

    </tr>

    <tr>

    <td style="width: 25px; height: 283px" valign="top">

    <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" BackColor="White" Height="35px" Width="464px" ForeColor="#7E90A7" Orientation="Horizontal" DynamicVerticalOffset="5">

    <DynamicHoverStyle BackColor="White" />

    <DynamicMenuStyle BackColor="#7E90A7" />

    <DynamicSelectedStyle BackColor="White" ForeColor="White" />

    <DynamicMenuItemStyle BackColor="White" ForeColor="#7E80A7" />

    </asp:Menu>

    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" />

    <br />

    <asp:ContentPlaceHolder ID="Main" runat="server">

    </asp:ContentPlaceHolder>

    <br />

    </td>

    <td style="width: 145px; height: 283px" valign="top">

    <strong><span style="color: #ffffff">Phone:

    <br />

    xxx-xxx-xxxx<br />

    <br />

    FAX:<br />

    xxx-xxx-xxxx<br />

    <br />

    Address:<br />

    withheld

    <br />

    <br />

    E-Mail:<br />

    withheld<br />

    <br />

    &copy Company Name. </span><a href="privpol.aspx"><span style="color: #ffffff">

    Privacy Policy</span></a></strong></td>

    </tr>

    <tr>

    <td style="width: 25px; height: 18px;">

    </td>

    <td style="width: 145px; height: 18px;">

    </td>

    </tr>

    </table>

    &nbsp;

    </div>

    </form>

    </body>

    </html>

    Sid Childers
    sid@webdbapps.net
  • Re: Master Page Content Place Holder Changes Shape

    08-30-2007, 3:00 AM
    Answer
    • Contributor
      2,273 point Contributor
    • Johnson2007
    • Member since 05-17-2007, 3:19 AM
    • Posts 449

     Do not set the table column's width to a fix value which contains the content control. For detail, that is remove the bold face settings shown in the following.

    <td style="width: 25px; height: 283px" valign="top">"

    entirely, the aspx code should be changed to the following. 

      

    <%@ 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 id="Head1" runat="server">
    <title>MasterPage</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    </head>
    <body style="font-size: 10pt; color: white; font-family: Tahoma" bgcolor="#7e90a7" alink="#ffffff" link="#ffffff" text="#ffffff" vlink="#66ccff">
    <form id="form1" runat="server">
    <div>
    <table>
    <tr>
    <td colspan="2" style="height: 236px">
     <asp:Image ID="Image1" runat="server" ImageAlign="Top" ImageUrl="~/Images/topF.jpg"
    Width="980px" Height="227px" /></td>
    </tr>
    <tr>
    <td style=" height: 283px" valign="top">
    <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" BackColor="White" Height="35px" Width="464px" ForeColor="#7E90A7" Orientation="Horizontal" DynamicVerticalOffset="5">
    <DynamicHoverStyle BackColor="White" />
    <DynamicMenuStyle BackColor="#7E90A7" />
    <DynamicSelectedStyle BackColor="White" ForeColor="White" />
    <DynamicMenuItemStyle BackColor="White" ForeColor="#7E80A7" />
    </asp:Menu>
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" />
    <br />
    <asp:ContentPlaceHolder ID="Main" runat="server">
    </asp:ContentPlaceHolder>
    <br />
    </td>
    <td style="height: 283px" valign="top">
    <strong><span style="color: #ffffff">Phone:
    <br />
    xxx-xxx-xxxx<br />
    <br />
    FAX:<br />
    xxx-xxx-xxxx<br />
    <br />
    Address:<br />
    withheld
    <br />
    <br />
    E-Mail:<br />
    withheld<br />
    <br />
    © Company Name. </span><a href="privpol.aspx"><span style="color: #ffffff">
    Privacy Policy</span></a></strong></td>
    </tr>
    <tr>
    <td style=" height: 18px;">
    </td>
    <td style="width: 145px; height: 18px;">
    </td>
    </tr>
    </table>
     
    </div>
    </form>
    </body>
    </html>
     
    Johnson
Page 1 of 1 (2 items)