1

ボタン、onClickイベントがあり、Oracle DB から .xmlGridView内にデータをロードしたいModalPopupExtender

問題は、Modalpopup が表示されているが、gridView にデータがロードされていないことです。

誰が私がどこを間違えたのか教えてもらえますか?

ASPコード

     <asp:Label ID="dummyLabel" runat="server" />
                    <ajax:ModalPopupExtender ID="mpeServiceType" runat="server" TargetControlID="dummyLabel" CancelControlID="BtnCloseServiceTypeMPE" Drag="true" PopupControlID="pnlServiceType" Enabled="True" >
                    </ajax:ModalPopupExtender>
 <asp:Button runat="server" ID="btnSelectServiceType" Text="Select Srv Type" OnClick="btnSelectServiceType_Click" />   
      <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="conditional" ChildrenAsTriggers="true">
                <ContentTemplate>
                    <asp:Button ID="Button2" Style="display: none" runat="server" Width="120" Text="Filter Charges" ToolTip="show Chargefilter-Dialog" />
                    <asp:Button ClientIDMode="Static" ID="BtnCloseServiceTypeMPE" Text="Close" ToolTip="close filter-dialog" CausesValidation="false" Width="150px" runat="server" /><br />
                    <table border="1">
                        <tr>
                            <td dir="rtl">
                                 <asp:GridView ID="gvServiceType" runat="server" 

CssClass="mGrid" AlternatingRowStyle-CssClass="alt" DataKeyNames="APP_ID,SRV_TYPE"

 AutoGenerateColumns="False" OnSelectedIndexChanged="gvServiceType_SelectedIndexChanged">
                                      <Columns>
                                        <asp:BoundField DataField="APP_ID" HeaderText=(APP_ID)" ReadOnly="True" SortExpression="APP_ID" />
                                        <asp:BoundField DataField="SRV_TYPE" HeaderText="SRV_TYPE)" SortExpression="SRV_TYPE" ReadOnly="True" />
                                        <asp:BoundField DataField="SRV_NAME" HeaderText="SRV_NAME)" SortExpression="SRV_NAME" />
                                        <asp:TemplateField HeaderText="Select">
                                            <ItemTemplate>
                                                <asp:Button ID="btnSelect" runat="server" CommandName="Select" Text="Select" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                      </asp:GridView>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>

C# コード

 protected void btnSelectServiceType_Click(object sender, EventArgs e)
        {
            string strSQLconnection = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.24)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=PROD)));User Id=aaziz;Password=32145;";
            OracleConnection conn = new OracleConnection(strSQLconnection);
            OracleCommand sqlCommand = new OracleCommand("select * from INCOME.srv_types where APP_ID='3' AND SRV_TYPE='8'", conn);
            conn.Open();
            OracleDataReader reader = sqlCommand.ExecuteReader();
            gvServiceType.DataSource = reader;
            gvServiceType.DataBind();
            mpeServiceType.Show();
}
4

1 に答える 1