单击事件以更新更新面板内的gridview未触发

时间:2014-01-29 03:40:56

标签: c# asp.net ajax updatepanel postback

我在更新面板中有一个gridview和一个弹出模式。

单击gridview单元格时,模式弹出窗口将显示,并将包含该单元格的信息。

之后,无法再触发gridview外部的点击事件。

请帮忙。

    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <table>
        <tr>
            <td align="center">
                <asp:TextBox ID="datepicker" runat="server"></asp:TextBox>
            </td>
            <td align="center">
                <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click"> GO</asp:LinkButton>
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="inventoryUpdatePanel" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="LinkButton1" />
            <asp:PostBackTrigger ControlID="cancelButton"/>

        </Triggers>
        <ContentTemplate>
            <div>
                <asp:GridView ID="inventoryGridview" runat="server" OnRowDataBound="inventoryGridview_RowDataBound"
                OnRowCommand="inventoryGridview_RowCommand" Font-Names="Arial" Font-Size="8.5pt"
                CssClass="inventoryGridviewCSS">
                <Columns>
                    <asp:ButtonField CommandName="ColumnClick" Visible="false" />
                </Columns>
                <HeaderStyle Font-Bold="True" Font-Size="8.5pt" />
            </asp:GridView>
        </div>


<div id="viewDetailsDiv" runat="server">
    <asp:Button ID="btnPopUp" runat="server" Style="display: none" />
    <asp:ModalPopupExtender ID="viewDetails" runat="server" TargetControlID="btnPopUp"
        PopupControlID="pnlpopup" CancelControlID="CancelButton" BackgroundCssClass="modalBackground"
        OnLoad="viewDetails_Load">
    </asp:ModalPopupExtender>
    <asp:Panel ID="pnlpopup" runat="server" BackColor="White">
        <table style="border: Solid 3px black; width: 260px; height: 250px; font-family: Arial;
            font-size: 14; padding: 5px 10px 5px 10px" cellpadding="0" cellspacing="0">
            <tr style="background-color: #7AC7F0">
                <td colspan="2" style="height: 2px; color: White; font-weight: bold;" align="center">
                    DETAILS
                </td>
            </tr>
            <tr style="background-color: #7AC7F0">
                <td colspan="2" style="height: 2px; color: White; font-weight: bold;" align="center">
                    <asp:Label ID="roomLabel" runat="server" Text="Room"></asp:Label>
                    -
                    <asp:Label ID="dateLabel" runat="server" Text="Date"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="allotmentLabel" runat="server" Text="Allotment: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="allotmentTextBox" runat="server" Height="20px" MaxLength="1" onkeypress="return isWholeNumber(event)"></asp:TextBox>
                    <asp:RangeValidator ID="allotmentRangeValidator" Display="Dynamic" Type="Integer"
                        MaximumValue="5" MinimumValue="1" EnableClientScript="true" ControlToValidate="allotmentTextBox"
                        runat="server" SetFocusOnError="true" ErrorMessage="May allot from 1-5 rooms only."
                        ForeColor="Red" Font-Size="10px"></asp:RangeValidator>
                </td>
                <tr>
                    <td>
                        <asp:Label ID="reservedLabel" runat="server" Text="Reserved: "></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="reservedTextBox" runat="server" Enabled="false" Height="20px" onkeypress="return isWholeNumber(event)"></asp:TextBox>
                    </td>
                </tr>
            <tr>
                <td>
                    <asp:Label ID="availableLabel" runat="server" Text="Available: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="availableTextBox" runat="server" Enabled="false" Height="20px" onkeypress="return isWholeNumber(event)"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="rateLabel" runat="server" Text="Rate: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="rateTextBox" runat="server" Height="20px" MaxLength="9" onkeypress="return isNumberKey(event)"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="rateRegularExpressionValidator" runat="server"
                        ControlToValidate="rateTextBox" ValidationExpression="^\d{0,8}(\d\.\d?|\.\d)?\d?$"
                        ErrorMessage="Invalid input." Display="Dynamic" SetFocusOnError="true" ForeColor="Red"
                        Font-Size="10px"></asp:RegularExpressionValidator>
                    <asp:RangeValidator ID="rateRangeValidator" Display="Dynamic" Type="Double" MaximumValue="999999999"
                        MinimumValue="1" EnableClientScript="true" ControlToValidate="rateTextBox" runat="server"
                        SetFocusOnError="true" ErrorMessage="Rate cannot be zero (0)." ForeColor="Red"
                        Font-Size="10px"></asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center" height="10px">
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Button ID="saveButton" runat="server" Text="SAVE" Width="80px" />
                    <asp:Button ID="cancelButton" runat="server" Text="CANCEL" Width="80px" OnClick="cancelButton_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</div>
            </ContentTemplate>
        </asp:UpdatePanel>

<div>
    <asp:Label ID="selectedRoom" runat="server" Text="Label"></asp:Label>
    <asp:Label ID="selectedDate" runat="server" Text="Label"></asp:Label>
</div>
<div id="previousNext">
    <asp:LinkButton ID="previousLinkButton" runat="server" OnClick="previousLinkButton_Click">Previous 21 days</asp:LinkButton>
    <asp:LinkButton ID="nextLinkButton" runat="server" OnClick="nextLinkButton_Click">Next 21 days</asp:LinkButton>
</div>

0 个答案:

没有答案