Link to home
Start Free TrialLog in
Avatar of jknj72
jknj72

asked on

Modal Popup Extender control

I have the following code

<cc1:ModalPopupExtender ID="PopupApproveTimesheets" runat="server" TargetControlID="HiddenField2" CancelControlID="btnBatchCancel" PopupControlID="Panel2" OkControlID="btnBatchApprove" >  
</cc1:ModalPopupExtender>

    <asp:HiddenField ID="HiddenField2" runat="server" />
    <asp:Panel ID="Panel2" runat="server" BorderColor="Black" BorderStyle="Solid" BorderWidth="1" Width="350px" Height="250px" style="display:none">
            <table style="border:3px Solid #7092BE; width:100%; height:100%;background-color:white;" cellpadding="0" cellspacing="0">        
                <tr style="background-color:#7092BE;padding:5px">
                    <td colspan="2" style=" height:10%; color:White; font-weight:bold; font-size:larger" align="center">Approve Timesheets</td>
                </tr>
                <tr style="padding:5px;">
                    <td align="center">
                        Week IDs:
                    </td>
                    <td style="padding-left:10px">
                        <asp:Label ID="lblWeeks" runat="server" Text="" Font-Bold="true" ></asp:Label>
                    </td>
                </tr>

                <tr style="padding:5px;padding-top:10px;">
                    <td align="center" style="vertical-align:top;" class="auto-style3">
                        Signature:
                    </td>
                    <td style="vertical-align:top;padding-left:10px;height:10%; color:White; font-weight:bold; font-size:larger" align="left"">
                        <asp:TextBox ID="txtSignature" runat="server" Text="" Width="200px" /> <%--Height="160px"--%>
                        &nbsp;<asp:Imagebutton id="imgSignature" runat="server" ImageUrl="~/images/icon-edit.gif" ImageAlign="Top" ToolTip="Click for Digital Signature" Height="22px" OnClientClick="return false;" Width="23px" />
                    </td>
                </tr>
                <tr style="padding:5px;padding-top:10px;">
                    <td align="center" style="vertical-align:top;" class="auto-style3">
                        Initials:
                    </td>
                    <td style="vertical-align:top;padding-left:10px;height:10%; color:White; font-weight:bold; font-size:larger" align="left"">
                        <asp:TextBox ID="txtInitials" runat="server" Text="" Width="120px" /> <%--Height="160px"--%>
                    </td>
                </tr>

                <tr>
                    <td class="auto-style3">
                    
                    </td>
                    <td align="center" class="auto-style4">
                        <asp:Button ID="btnBatchApprove" runat="server" Text="Ok" OnClick="btnBatchApprove_Click" Width="100px"/>
                       
                        &nbsp&nbsp
                        <asp:Button ID="btnBatchCancel" runat="server" Text="Cancel" OnClick="btnBatchCancel_Click" Width="100px"/>
                    
                    </td>

                </tr>
            </table>
        </asp:Panel>

Open in new window


I have to have the OK_Click to run so I can set the values in the Popup so I am using the hiddenfield as a fake button for my TargetControlID and in the code behind in a btn click event I have this code....

    Protected Sub btnApproveWeek_Click(sender As Object, e As EventArgs) Handles btnApproveWeek.Click
        Dim bUpdate As Boolean = False
        Dim weekid As Integer = Session("AdminWeekID")
        Dim statusid As Integer = Session("StatusID")

        imgSignature.ImageUrl = "~/images/icon-edit.gif"
        lblWeeks.Text = GetWeekIDs(0)
       
       ' Panel2.Attributes.CssStyle("display") = "block"   'I have tried this as well
        PopupApproveTimesheets.Show()

    End Sub

Open in new window



Nothing is appearing and this has worked prior to me having this issue.
I have had an issue with Popups not working with .Show being called. I would use the TargetControlID = btnApproveWeek but like I said I have to set the fields and when you set it as the target then the Click event doesnt fire??
Can anyone shed any light on this for me???
ASKER CERTIFIED SOLUTION
Avatar of jknj72
jknj72

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial