易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net里导出excel表或Word的方法

对于大量的数据,有时候导出到Excel中将更加方便进行数据统计分析,而对于排版打印则导出到World文档中更加方便。在ASP.NET可以通过少量代码实现这两种导出。
        新建一页面,该页面布局Html源码如下:
<form id="form1" runat="server"><div>
        <asp:Button ID="cmdOpen" runat="server" Text="在线打开" CommandName="open"
OnCommand="Button_Click" />&nbsp;<asp:Button ID="cmdSave"
            runat="server" Text="本地保存" CommandName="save"
OnCommand="Button_Click" />
        <asp:DropDownList ID="listType" runat="server">
            <asp:ListItem Value="excel">Excel</asp:ListItem>
            <asp:ListItem Value="word">Word</asp:ListItem>
        </asp:DropDownList><br />
        <br />
        数据源:<br />
        <br />
        <asp:GridView ID="myGW" runat="server">
        </asp:GridView>
    </div></form>
       这里没有什么特别的,只需要注意在线打开与本地保存两个按钮通过CommandName进行检验并触发相应的动作
,DropDownList控件存放了可以导出的格式,可以自己添加如txt、html等格式。准备工作就绪以后,可以进行代码的书写,以完成我们需要的功能:
    protected void Page_Load(object sender, EventArgs e)
    {
&


相关文档:

asp.net 枚举 string字符串 转为汉字

   public static string TheColor(string color,string enumName)
        {
            return string.Format("<span style=\"color={0}\">{1}</span>",color,enumName);
     ......

ASP.NET Events

Here is the full list of all events that occur in an ASP.NET application, from the standard modules, to the page, master page, page controls and master page controls.
I have not included the IIS 7 specific events (Log, for example).
What
When
HttpApplication.BeginRequest
HttpApplication.Auth ......

.NET、ASP.NET控件及源码大汇总

.NET、ASP.NET控件及源码大汇总
作者:Allan_Green  来源:博客园  发布时间:2009-02-12 10:33  阅读:224 次  原文链接   [收藏]  
.NET、ASP.NET控件及源码大汇总
CuteEditor 6.0 在线HTML编辑器的领航者
ComponentArt.Charting.WebChart.dll
Comp ......

用json格式返回自定义对象。(jQuery asp.net)

客户端用一个html页面调用一个ashx文件(一般http处理程序),返回json格式的自定义对象:
html:--------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w ......

Cascading DropDownLists With ASP.NET and jQuery


Cascading drop down lists is a really nice feature for web developers. I thought it was time to write an article on how to do this using ASP.NET and jQuery. Well here’s one way of doing it. Before we get started, this example uses the latest version of jQuery which is 1.3.2.&n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号