[RESOLVED] Button wont stay in fixed position!
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: [RESOLVED] Button wont stay in fixed position!

  1. #1
    Join Date
    Jan 2010
    Posts
    130

    [RESOLVED] Button wont stay in fixed position!

    Sorry for spamming the boards but I have another stupid question that I spent ages trying to answer :P

    I created two tables in ASP.NET with the lower one containing a submit button. In the higher one I programmatically add labels. The number of labels added depends on which radiobutton was selected earlier. In scenario 1 (check attachment 1) where one label appears the submit button is in the correct position. However when another label is added (attachment 2) then the button moves upwards!

    This is the relevant section from my ASP.NET page:

    Code:
    Bitte Wählen Sie einen Beurteilungsbogen aus. <br />    
        &nbsp; <br />
        
        <p>
        <asp:Table ID="tblReportSelection" runat="server" CssClass="tblReportSelection">
        </asp:Table>
        </p>
        
        <p>
        &nbsp;
        </p>
        
        <p>
        &nbsp;
        </p>
    
        <p>
        <div class="tblSubmitSelection">
            <asp:Button ID="btnReportSelection" runat="server" Text="Auswahl" OnClick="BtnReportSelection_Click" />
        </div>
        </p>
    Here is the relevant section from my stylesheet
    Code:
    .tblReportSelection {
    	float: left;
    	border: solid 1px #373188;
    	padding: 5px;
    	padding-right: 20px;
    	text-align: left;
    }
    .tblSubmitSelection {
    	float: left;
    }
    Attached Images Attached Images   

  2. #2
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: Button wont stay in fixed position!

    Hi,

    I don't see what is wrong. The button doesn't look like its gone upwards...to me. Can you expain how it should look when you have more than 1 label? Thanks.

  3. #3
    Join Date
    Jan 2010
    Posts
    130

    Re: Button wont stay in fixed position!

    What I mean is that the space between the button and the table decreased when a second label was added...

  4. #4
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: Button wont stay in fixed position!

    And what happens when you have more than 2 labels? As an aside you don't need to have the 'div' within the 'p' for the submit button. I suspect that the content of the table overflows over the 'div' and 'p' elements where the button is. I suspect that is to do with the 'float' set against the div. One think you can is to specify the 'overflow' property against the container for the table (i.e. the 'p' containing the table). Something like 'overflow:auto' might do the trick.

  5. #5
    Join Date
    Jan 2010
    Posts
    130

    Re: Button wont stay in fixed position!

    I added the button programmatically on a new row in the same table and now no matter how many labels one adds, it still stays fixed But I will keep in mind what you said

  6. #6
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: [RESOLVED] Button wont stay in fixed position!

    Quote Originally Posted by stephsh
    I added the button programmatically on a new row in the same table and now no matter how many labels one adds, it still stays fixed
    That is a good solution. Sometimes we have to for a good solution instead of the best solution to achieve the ultimate goal within a reasonable amount of time.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center