1

我在更新面板中有一个gridview,并希望允许用户选择一行,该行将生成对将流输出回客户端的类的调用。看起来我不能这样做,因为网格位于更新面板内。有任何想法吗?

C#

    protected void gvResults_SelectedIndexChanged(object sender, EventArgs e)
    {
        RMATagsReport rpt = new RMATagsReport();
        rpt.GenerateReport();
    }

ASP.NET

<asp:UpdatePanel ID="upResults" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
    <asp:GridView ID="gvResults" runat="server" AutoGenerateColumns="False" CellPadding="4"
        ForeColor="#333333" OnSelectedIndexChanged="gvResults_SelectedIndexChanged" Width="100%">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:BoundField DataField="CSTNO" HeaderText="DEALER" />
            <asp:BoundField DataField="ORDNO" HeaderText="RMA NUMBER" />
            <asp:BoundField DataField="CSTORD" HeaderText="DEALER PO NUMBER" />
            <asp:BoundField DataField="ORDDTE" HeaderText="ORDER DATE" />
            <asp:BoundField DataField="INVDTE" HeaderText="INVOICE DATE" HtmlEncode="false" />
            <asp:CommandField SelectText="Print RMA" ShowSelectButton="True" />
        </Columns>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#3494CC" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
        <EditRowStyle BackColor="#999999" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <EmptyDataTemplate>
            <span style="color: Red;">No RMA Tags Found With Specified Criteria. </span>
        </EmptyDataTemplate>
    </asp:GridView>
    <div id="LoadingDiv" style="display: none; text-align: center;">
        <img src="Graphics/Icons/loading_lg.gif" />
    </div>
    <div id="ResultsDiv">
    </div>
</ContentTemplate>
<Triggers>
    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
</Triggers>

4

1 回答 1

2

我现在正在对索引更改进行 response.redirect,新页面处理报告生成......这似乎工作正常。

编辑
虽然这似乎可行,但我仍然对其他可能性持开放态度,因为我不想拥有一个唯一目的是输出此文档的页面。

于 2009-02-17T02:55:41.063 回答