Control dont work

Last post 07-17-2006 2:33 PM by David Anson. 5 replies.

Sort Posts:

  • Control dont work

    07-11-2006, 11:42 AM
    • Member
      15 point Member
    • SamuraiJeff
    • Member since 07-11-2006, 3:36 PM
    • Posts 3
    I have a form with some fields inside a UpdatePanel. And I also have some panels that I'm using as modal panels (just like in the Atlas Control Toolkit examples).

    Thats the modal code: 
    1        <atlasToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server">
    2 <atlasToolkit:ModalPopupProperties TargetControlID="btnGravar" PopupControlID="pnlContPag" BackgroundCssClass="modalBackground" DropShadow="true" CancelControlID="btContpagCancela"/>
    3 <atlasToolkit:ModalPopupProperties TargetControlID="btnDeletar" PopupControlID="pnlDelete" BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="btnDelSim" CancelControlID="btnDelNao"/>
    4 </atlasToolkit:ModalPopupExtender>
     
    My Problem is: When I try the modals when the fields are empty, the buttons works. But when I load data from the database into the fields, the modal works, but the buttons inside its panels dont!!!

    I'm almost getting insane!!

    Could anybody help me ?
  • Re: Control dont work

    07-11-2006, 5:24 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-10-2006, 9:39 PM
    • Microsoft
    • Posts 1,842
    • AspNetTeam
    Please post a complete page that demonstrates the problem as simply as possible - we'll look into it.

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Control dont work

    07-14-2006, 9:16 AM
    • Member
      15 point Member
    • SamuraiJeff
    • Member since 07-11-2006, 3:36 PM
    • Posts 3
    Here is it.
    I have a panel called pnlDelete, which have 2 buttons. One of them kills the record, the other does nothing.
    The problem is: The buttons do not work!

     
    1    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    2    
    3    <%@ Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %>
    4    
    5    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    6    
    7    <html xmlns="http://www.w3.org/1999/xhtml" >
    8    <head runat="server">
    9        <title>Transufos::Serviços de Oficina</title>
    10       <style>
    11           .modalBackground {
    12   	        background-color:Gray;
    13   	        filter:alpha(opacity=50);
    14   	        opacity:0.5;
    15           }
    16           .modalPopup {
    17   	        background-color:#ffffdd;
    18   	        border-width:3px;
    19   	        border-style:solid;
    20   	        border-color:Gray;
    21   	        padding:3px;
    22           }
    23       </style>
    24   </head>
    25   <body>
    26   <form id="form1" runat="server">
    27       <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="XX-Large" ForeColor="Blue"
    28           Style="z-index: 108; left: 8px; top: 477px" Width="336px">Serviços de Oficina</asp:Label><br />
    29           
    30       <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
    31   
    32       
    33   
    34       <atlas:UpdateProgress ID="UpdateProgress1" runat="server">
    35   	    <ProgressTemplate>
    36                <asp:Panel ID="Panel1" runat="server" Height="55px" Width="173px" BackColor="LightYellow" style="z-index: 999; left: 248px; position: absolute; top: 285px" BorderStyle="Solid" BorderWidth="2px" BorderColor="DarkRed">
    37                   <asp:Image ID="Image2" runat="server" ImageUrl="~/animated_loading.gif" Style="z-index: 100;
    38                       left: 23px; position: absolute; top: 22px" />
    39                   <br />
    40                    <strong>
    41                                
    42                   Carregando ... </strong>
    43               </asp:Panel>
    44   	    </ProgressTemplate>
    45       </atlas:UpdateProgress>
    46              
    47   
    48     <atlas:UpdatePanel runat="server" ID="UpdatePanel1" Mode="Conditional">
    49     
    50       <ContentTemplate>
    51           
    52           <br />
    53           <br />
    54           
    55           <asp:Label ID="lblMessage" runat="server" ForeColor="Red" Style="left: 24px; top: 970px"
    56               Width="708px" Height="37px"></asp:Label><br />
    57               
    58           
    59           
    60           <div style="display:none">
    61           <asp:Panel ID="pnlDelete" runat="server" BackColor="Salmon" BorderColor="Red" BorderStyle="Solid"
    62               BorderWidth="2px" Height="80px" Style="z-index: 112; left: 780px; position: absolute;
    63               top: 444px" Width="328px">
    64               <p align="center">
    65                   <strong><font color="#000000">Este registro será EXCLUÍDO. Tem certeza?</font></strong></p>
    66               <p align="center">
    67                   <asp:Button ID="btnDelSim" runat="server" BackColor="White" CausesValidation="False"
    68                       Font-Bold="True" ForeColor="Red" OnClick="btnDelSim_Click" Text="Sim" BorderStyle="Outset" />
    69                                 
    70                   <asp:Button ID="btnDelNao" runat="server" BackColor="White" CausesValidation="False"
    71                       Font-Bold="True" ForeColor="Red" OnClick="btnDelNao_Click" Text="Não" /></p>
    72           </asp:Panel>
    73           </div>
    83           
    84          
    85           <!-- Modais //-->
    86       <atlasToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server">
    87           <atlasToolkit:ModalPopupProperties TargetControlID="btnGravar" PopupControlID="pnlContPag" BackgroundCssClass="modalBackground" DropShadow="true"  CancelControlID="btContpagCancela"/>
    88           <atlasToolkit:ModalPopupProperties TargetControlID="btnDeletar" PopupControlID="pnlDelete" BackgroundCssClass="modalBackground" DropShadow="true"  OkControlID="btnDelSim" CancelControlID="btnDelNao" />
    89       </atlasToolkit:ModalPopupExtender>
    90       <!-- Fim dos modais //-->
    91           
    92           
    93           
    94           
    95           <asp:LinkButton ID="btnConsultar" runat="server" BackColor="Transparent" CausesValidation="False"
    96               Font-Bold="True" ForeColor="Black" OnClick="btnConsultar_Click" Style="left: 750px;
    97               position: absolute; top: 138px">Consultar</asp:LinkButton>
    98           <asp:LinkButton ID="btnGravar" runat="server" BackColor="Transparent" Font-Bold="True"
    99               ForeColor="Black" OnClick="btnGravar_Click" Style="left: 758px; position: absolute;
    100              top: 212px" TabIndex="34" Width="45px">Gravar</asp:LinkButton>
    101          <asp:LinkButton ID="btnDeletar" runat="server" BackColor="Transparent" CausesValidation="False"
    102              Font-Bold="True" ForeColor="Black" OnClick="btnDeletar_Click" Style="left: 758px;
    103              position: absolute; top: 286px">Deletar</asp:LinkButton>
    104           
    105      </ContentTemplate>
    106  
    107  
    108    </atlas:UpdatePanel>
    109  
    110  </form>
    111  </body>
    112  </html>
    
     
    thankx
  • Re: Control dont work

    07-14-2006, 6:38 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-10-2006, 9:39 PM
    • Microsoft
    • Posts 1,842
    • AspNetTeam
    I'm afraid your sample doesn't completely work for me. "pnlContPag" isn't present, so only one of the two ModalPopups can work. pnlDelete is wrapped in "<div style="display:none">" so it's never visible. Removing that display:none wrapper lets me see the delete panel and it seems that hitting either button in it works. Recall that the controls specified by ModalPopup's OkControlID/CancelControlID don't postback anymore, but instead run whatever code's been specified by OnOkScript/OkCancelScript. Might this be the issue?

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Control dont work

    07-17-2006, 8:35 AM
    • Member
      15 point Member
    • SamuraiJeff
    • Member since 07-11-2006, 3:36 PM
    • Posts 3
    Yeah, your are right, I have ommited some lines :)
    It was really huge!!!!!!

    But I'm having the same problem with the 'pnlContPag' and the 'pnlDelete'

    hmmm...
    It haven't worked.
    The greatest problem is that I'm losing the reference to the code-behind events when using the modal panel. I need them to postback so I can delete (in the case of the pnlDelete...) the current record. I already have the functions on the .cs file with the code to delete the record.

    HELP MEEEE!


    Thanks again for the help!

    Jeff

  • Re: Control dont work

    07-17-2006, 2:33 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-10-2006, 9:39 PM
    • Microsoft
    • Posts 1,842
    • AspNetTeam
    If you want a control in the ModalPopup to postback, don't hook it up as an Ok/Cancel button. It should postback normally and the act of posting back will dismiss the ModalPopup.

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (6 items)