摘要: Dictionary<string, string> dic = GetRoleDescriptions(); string key = dic.FirstOrDefault(x => x.Value == ddlSearchRoleDes.SelectedItem.Text.Trim().ToUpper()).Key; 阅读全文
posted @ 2013-06-20 22:58 stevejson 阅读(555) 评论(0) 推荐(0) 编辑
摘要: 前台界面: <asp:GridView ID="GridView1" runat="server" Width="100%" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" AllowPaging="True" PageSize="12" OnRowCancelingEdit="GridView1_RowCancelingEdit" 阅读全文
posted @ 2013-06-20 22:56 stevejson 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 本代码实现思路是:页面显示和导出分开,导出的数据和用于页面显示的是同一查询数据方式,所以也是同样的数据,只是在导出数据时从数据库重新捞了一次数据。此导出数据方式会先将数据保存到Excel中,然后将创建的Excel文件保存到服务器指定位置,然后下载到客户端,下载完后立即删除掉刚在服务器上创建的Excel文件。 // 导出按钮事件protected void btOutputData_Click(object sender, EventArgs e) { ExportExcel(GetPrintingData(ViewState["ssearchCondition"].ToSt 阅读全文
posted @ 2013-06-20 21:32 stevejson 阅读(1186) 评论(0) 推荐(0) 编辑