<asp:UpdatePanel runat="server" ID="UpdatePanel2"> <ContentTemplate> <SOA:DeluxeGrid ID="dgTemps" runat="server" DataKeyNames="Id" DataSourceID="datasource" PageSize="10" AutoGenerateColumns="False" DataSourceMaxRow="0" AllowPaging="True" CssClass="dataList" Width="100%" MultiSelect="true"> <Columns> <asp:BoundField HeaderText="编码" DataField="Id" Visible="false" /> <%--<asp:BoundField HeaderText="报表名称" DataField="ReportName" />--%> <asp:TemplateField HeaderText="报表名称"> <ItemTemplate> <div> <a href="#" onclick="myfunction(this,'<%#Eval("Id") %>','<%#Eval("ReportName") %>')" ><%#Eval("ReportName") %></a> </div> </ItemTemplate> </asp:TemplateField> </Columns> <HeaderStyle CssClass="head" /> <PagerStyle CssClass="pager" /> <RowStyle HorizontalAlign="Left" CssClass="item" /> <AlternatingRowStyle HorizontalAlign="Left" CssClass="aitem" /> <EmptyDataTemplate> 暂时没有您需要的数据 </EmptyDataTemplate> <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NextPreviousFirstLast" NextPageText="下一页" Position="Bottom" PreviousPageText="上一页"></PagerSettings> </SOA:DeluxeGrid> <SOA:DeluxeObjectDataSource ID="datasource" runat="server" EnablePaging="True" TypeName="MCS.Library.SOA.DataObjects.DataSources.ReportDataSource"> <SelectParameters> </SelectParameters> </SOA:DeluxeObjectDataSource> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="click" /> </Triggers> </asp:UpdatePanel>
js代码
function myfunction(obj,ReportId, ReportName) { var url = "ExportingReport.aspx?ReportId=" + ReportId + "&ReportName=" + escape(ReportName) + ""; obj.href = url; obj.target = "_blank"; }
myfunction方法里面 可以添加 其它异步操作的方法,实现其它业务,
注意事项,经过几次测试,必须把this这个对象传递过来,不然会有其它问题。