乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      asp.net ajax技巧-主從gridview動態(tài)更新

       悟靜 2012-04-30
      下面是異步的一對多流程,有兩個gridview,上面一個gridview是主,下面一個GRIDVIEW顯示的是從,當(dāng)點
      主表的數(shù)據(jù)時,下面的GRIDVIEW顯示對應(yīng)的數(shù)據(jù)(DETAIL),要注意的是,為了防止浪費時間,把兩個GRIDVIEW
      放到兩個不同的updatepannel中去,并且設(shè)計兩個UPDATEPANNEL控件的updatemode屬性為conditional,這樣當(dāng)在下方的GRIDVIEW控件排序時,上方的UPDATEPANNEL控件不會被局部更新
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
                  <asp:UpdatePanel ID="OrdersPanel" UpdateMode="Conditional" runat="server">
                      <ContentTemplate>
                          <asp:GridView ID="GridView1" AllowPaging="True" AllowSorting="True" Caption="訂貨主檔的訂單數(shù)據(jù)"
                              DataKeyNames="訂單號碼" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                              runat="server" Width="608px" BackColor="LightGoldenrodYellow" BorderColor="Tan"
                              BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" SelectedIndex="0"
                              OnPageIndexChanged="GridView1_PageIndexChanged">
                              <Columns>
                                  <asp:CommandField ShowSelectButton="True"></asp:CommandField>
                              </Columns>
                              <FooterStyle BackColor="Tan" />
                              <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                              <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
                              <HeaderStyle BackColor="Tan" Font-Bold="True" />
                              <AlternatingRowStyle BackColor="PaleGoldenrod" />
                          </asp:GridView>
                          <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:chtNorthwind %>"
                              SelectCommand="SELECT 訂單號碼,客戶編號,員工編號,訂單日期 FROM dbo.訂貨主檔"></asp:SqlDataSource>
                      </ContentTemplate>
                  </asp:UpdatePanel>
                  <br />
                  <asp:UpdatePanel ID="OrderDetailsPanel" UpdateMode="Conditional" runat="server">
                      <ContentTemplate>
                          <asp:GridView ID="GridView2" runat="server" BackColor="White" BorderColor="#E7E7FF"
                              BorderStyle="None" BorderWidth="1px" Caption="訂貨明細(xì)資料" CellPadding="3" DataKeyNames="訂單號碼,產(chǎn)品編號"
                              DataSourceID="SqlDataSource2" GridLines="Horizontal" Width="608px" AllowSorting="True">
                              <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                              <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                              <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                              <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                              <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                              <AlternatingRowStyle BackColor="#F7F7F7" />
                              <EmptyDataTemplate>
                                  <b><i>請您從以上的清單中選取一筆訂單.....</i></b>
                              </EmptyDataTemplate>
                              <EmptyDataRowStyle BackColor="#404040" ForeColor="Red" />
                          </asp:GridView>
                          <br />
                          <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:chtNorthwind %>"
                              SelectCommand="SELECT 訂單號碼,產(chǎn)品編號,單價,數(shù)量,折扣 FROM dbo.訂貨明細(xì) WHERE (訂單號碼 = @OrderID)"
                              runat="server">
                              <SelectParameters>
                                  <asp:ControlParameter ControlID="GridView1" Name="OrderID" PropertyName="SelectedValue"
                                      Type="Int32" />
                              </SelectParameters>
                          </asp:SqlDataSource>
                      </ContentTemplate>
                      <Triggers>
                          <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="SelectedIndexChanged" />
                          <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="PageIndexChanged" />
                          <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="Sorted" />
                      </Triggers>
                  </asp:UpdatePanel>

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多