Strange formatting problem when using masterpages.

Last post 09-19-2005 12:55 PM by washoetech. 5 replies.

Sort Posts:

  • Strange formatting problem when using masterpages.

    09-09-2005, 3:01 PM
    • Member
      120 point Member
    • washoetech
    • Member since 10-10-2004, 12:32 AM
    • Posts 24
    I am having a formatting problem with ASP 2.0 using master pages.  I am using the Vusial Studio 2005 Web Developer Express Beta 2

    I took screen shots of the problem I am having because it it hard to explain. 

    This is what my page looks like in design view:
    http://www.washoetech.net/before.jpg

    This is what my page looks like when I run it:
    http://www.washoetech.net/after.jpg

    I have had this problem before using Visual Studio 2005 Beta 2 as well.  Could never figure it out.

    Any help is appreciated!

    Thanks,

    washoetech
    Your resident Code monkey!!!!

    Check out my latest ASP.NET 2.0 project http://www.fwicki.com
  • Re: Strange formatting problem when using masterpages.

    09-09-2005, 4:54 PM
    • Participant
      1,577 point Participant
    • WimH
    • Member since 09-04-2005, 11:05 AM
    • UK
    • Posts 301
    Personally, I don't tend to use design view very often.

    But my guess is that some of the HTML may be a bit mangled up, so you might have to inspect your design time vs. run-time HTML in more depth, compare it, and see where the differences are.

    Wim

    Wim Hollebrandse
    ---
    http://www.zealandit.com
  • Re: Strange formatting problem when using masterpages.

    09-09-2005, 4:54 PM
    • Contributor
      2,738 point Contributor
    • kashif
    • Member since 06-11-2002, 1:34 PM
    • Posts 547
    • AspNetTeam
      Moderator
    Can you provide the html for your table? Looking at the pictures it looks like the right column is not maintaining its width at runtime compared to as seen at designtime.

    Thanks,
    Kashif
  • Re: Strange formatting problem when using masterpages.

    09-09-2005, 5:11 PM
    • Member
      120 point Member
    • washoetech
    • Member since 10-10-2004, 12:32 AM
    • Posts 24

    Here is the HTML for that page.

    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="create-template.aspx.vb" Inherits="create_template" title="Untitled Page" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="cphMain" Runat="Server">

    <br />

    <h1 style="text-align: center">

    Create Template</h1>

    <p>

    <table border="0" cellpadding="10" cellspacing="0" width="100%">

    <tr>

    <td style="width: 134px">

    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">

    <tr>

    <td style="width: 100px; height: 18px; text-align: left">

    </td>

    <td style="width: 100px; height: 18px; text-align: right">

    <asp:Button ID="btnSaveTemplate" runat="server" Text="Save Template" />&nbsp;<asp:Button

    ID="btnClearTemplate" runat="server" Text="Clear Template" />

    </td>

    </tr>

    <tr>

    <td style="width: 100px; height: 18px; text-align: left">

    <strong>Template Name</strong><br />

    <asp:TextBox ID="txtTemplateName" runat="server"></asp:TextBox></td>

    <td style="width: 100px; height: 18px; text-align: left">

    <strong>Data File Management<br />

    </strong>

    <asp:RadioButton ID="rbFileUpload" runat="server" AutoPostBack="True" Checked="True"

    GroupName="file_manage" Text="Upload File" />

    <asp:FileUpload ID="upFile" runat="server" BackColor="PaleGreen" Font-Names="Times New Roman"

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

    </tr>

    <tr>

    <td style="width: 100px; height: 23px">

    </td>

    <td style="width: 100px; height: 23px; text-align: left">

    <asp:RadioButton ID="rbFileURL" runat="server" AutoPostBack="True" GroupName="file_manage"

    Text="File URL" />&nbsp;<asp:TextBox ID="txtFileURL" runat="server" BackColor="LightCoral"

    Width="299px"></asp:TextBox></td>

    </tr>

    </table>

    </td>

    </tr>

    </table>

    <table border="0" cellpadding="10" cellspacing="0" width="100%">

    <tr>

    <td style="width: 100px; text-align: left">

    <asp:RadioButton ID="rbAutoConfig" runat="server" Checked="True" Font-Bold="True"

    GroupName="auto_man_config" Text="Auto Configuration" /></td>

    </tr>

    <tr>

    <td style="width: 100px; height: 19px">

    <br />

    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">

    <tr>

    <td style="width: 100px; height: 19px; text-align: left">

    <asp:CheckBox ID="chkColumnHeader" runat="server" Text="Use first row as column header?" /><br />

    <br />

    <strong>Select data file type:<br />

    </strong>

    <asp:DropDownList ID="cmbDataFileType" runat="server" Width="156px">

    <asp:ListItem>Select Data File Type</asp:ListItem>

    <asp:ListItem>XLS</asp:ListItem>

    <asp:ListItem>Comma Delimited</asp:ListItem>

    <asp:ListItem>Tab Delimited</asp:ListItem>

    <asp:ListItem>XML</asp:ListItem>

    </asp:DropDownList>&nbsp;<asp:Button ID="btnVerifyData" runat="server" Text="Verify Data File" /></td>

    </tr>

    <tr>

    <td style="width: 100px">

    </td>

    </tr>

    </table>

    </td>

    </tr>

    <tr>

    <td style="width: 100px">

    </td>

    </tr>

    <tr>

    <td style="width: 100px; text-align: left">

    <asp:RadioButton ID="rbManualConfig" runat="server" Font-Bold="True" GroupName="auto_man_config"

    Text="Manual Configuration" /></td>

    </tr>

    <tr>

    <td style="width: 100px">

    <br />

    <table border="0" cellpadding="5" cellspacing="0" style="width: 100%">

    <tr>

    <td style="width: 100px; text-align: left">

    <strong>Column Name</strong><br />

    <asp:TextBox ID="txtColumnName" runat="server" Width="201px"></asp:TextBox>&nbsp;<asp:DropDownList

    ID="cmbDataColumnType" runat="server" Width="189px">

    <asp:ListItem Selected="True">Select Data Column Type</asp:ListItem>

    <asp:ListItem>String</asp:ListItem>

    <asp:ListItem>Value</asp:ListItem>

    </asp:DropDownList>&nbsp;<asp:Button ID="btnAddColumn" runat="server" Text="Add Column" />&nbsp;<asp:Button

    ID="btnVerifyData2" runat="server" Text="Verify Data File" /></td>

    </tr>

    <tr>

    <td style="width: 100px; text-align: left">

    <asp:GridView ID="dgManualColumns" runat="server">

    </asp:GridView>

    </td>

    </tr>

    </table>

    </td>

    </tr>

    <tr>

    <td style="width: 100px; text-align: left">

    <strong>Sample Template Data<br />

    </strong>

    <br />

    <asp:GridView ID="dgSampleData" runat="server" EnableTheming="True">

    </asp:GridView>

    </td>

    </tr>

    <tr>

    <td style="width: 100px; text-align: left">

    <strong>Table Update Schedule</strong></td>

    </tr>

    <tr>

    <td style="width: 100px; text-align: right">

    <asp:Button ID="btnSaveTemplate2" runat="server" Text="Save Template" />&nbsp;<asp:Button

    ID="btnClearTemplate2" runat="server" Text="Clear Template" /></td>

    </tr>

    </table>

    </p>

    </asp:Content>

    Your resident Code monkey!!!!

    Check out my latest ASP.NET 2.0 project http://www.fwicki.com
  • Re: Strange formatting problem when using masterpages.

    09-19-2005, 10:52 AM
    • Member
      5 point Member
    • Sacouv
    • Member since 09-02-2005, 1:23 PM
    • Posts 1
    Hi There,

    I similarly had the same problems when I used designer and then my page came out the same way... Try changed your table cells to match the entire size that you set..Your first table cell you set to 134px and then inside that cell you put a table with 2 cells each with a width of 100px. When you do this, VS for some reason switches over to auto sizing to try and accomodate all cells. I found when I set the contents of the cells to be a little smaller than the cell itself you would be able to have a better layout in the webpage as VS uses your dimensions.... Try it out and let me know what happens..
    Cheers
    Shane
  • Re: Strange formatting problem when using masterpages.

    09-19-2005, 12:55 PM
    • Member
      120 point Member
    • washoetech
    • Member since 10-10-2004, 12:32 AM
    • Posts 24
    Thank you very much for your help with this problem.  It makes sense what you are saying.  I will try this out.

    Justin
    Your resident Code monkey!!!!

    Check out my latest ASP.NET 2.0 project http://www.fwicki.com
Page 1 of 1 (6 items)