ModalPopup not centered on screen

Last post 05-09-2008 4:04 PM by jfierst. 3 replies.

Sort Posts:

  • ModalPopup not centered on screen

    05-09-2008, 1:44 PM
    • Loading...
    • MajorCats
    • Joined on 08-30-2002, 1:13 PM
    • Kansas City, MO USA
    • Posts 434

    I am using a modal popup control on a page that is using a masterpage.  When i show the modal popup, it is in the extreme upper left corner of the page (not the content area which is centered in the page but the extreme upper left of the page as a whole) even though i have not assigned an X or Y value so it should be centered.  If I assign an X and Y value, it does place the popup where I have set it. Any suggestions to have it automatically center?

     Thanks,

    MajorCats
  • Re: ModalPopup not centered on screen

    05-09-2008, 3:53 PM
    • Loading...
    • jfierst
    • Joined on 09-10-2007, 2:51 PM
    • Posts 75

    All my modalpopups are horiz centered using a code similar to this:

     

    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1" TargetControlID="ETITLELabel" CancelControlID="Label5" DropShadow="False" OkControlID="Label5">
                </cc1:ModalPopupExtender>
             
                   <asp:Panel ID="Panel1" runat="server" Height="100%" Width="100%" BackImageUrl="images/transpbg95.png" HorizontalAlign="NotSet" style="display:none">
                       <br /><br />
                <table width="640px" style="width: 640px;" bgcolor="White" align="center">
                <tr>
                <td>
                
               
               
               </td>
                </tr>
                
                </table>
                 
        </asp:Panel> 
     
  • Re: ModalPopup not centered on screen

    05-09-2008, 4:00 PM
    Answer
    • Loading...
    • MajorCats
    • Joined on 08-30-2002, 1:13 PM
    • Kansas City, MO USA
    • Posts 434

    Ok, this is probably my being stupid...but I like to position a footer at the bottom of the page and I usually use a table with the height set to 100% and then the bottom row contains the footer info.  Well, if you have:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    at the top of the document, it appears to ignore the height setting...so I usually remove it so my table works like I want.  It appears that removing this is what is causing my problems with Ajax controls.

    MajorCats
  • Re: ModalPopup not centered on screen

    05-09-2008, 4:04 PM
    • Loading...
    • jfierst
    • Joined on 09-10-2007, 2:51 PM
    • Posts 75

    I believe I also ran into that problem when changing the doc type, so I stopped using it.

Page 1 of 1 (4 items)