Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

asp.netµ¼³ö³ÉEXCEL

ÒÔÏÂÊǵ¼³öµÄ·½·¨£º
public static void ToExcel(System.Web.UI.Control ctl)
    {
        //HttpContext.Current.Response.Charset   ="GB2312";  
        HttpContext.Current.Response.Charset = "GBK";
        HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=memory.xls");
        HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GBK");
        HttpContext.Current.Response.ContentType = "application/ms-excel";//image/JPEG;text/HTML;image/GIF;vnd.ms-excel/msword  
       
        ctl.Page.EnableViewState = false;
       
        System.IO.StringWriter tw = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
       
        ctl.RenderControl(hw);
       
        HttpContext.Current.Response.Write(tw.ToString());
        HttpContext.Current.Response.End();
    }
ÔÚÆäËü·½·¨Öе÷ÓãºToExcel(gridview1);


Ïà¹ØÎĵµ£º

asp.net(C#) Êý¾Ý¿â±¸·Ý»¹Ô­ Ô´Âë

Backup.aspx
  protected void Button1_Click(object sender, EventArgs e)
    {
        string path = Server.MapPath("") + @"\Backup";
        if (!Directory.Exists(path))
       ......

asp.net»ñÈ¡´«ÖµgetºÍpostÇëÇó

//postÇëÇó
string name = Request["name"].toString();
string name =Request.Form.Get("name").toString();
//getÇëÇó
string name = Request.QueryString["name"].toString();
µ«ÎÒ·¢ÏÖ ÎÞÂÛÊÇ·ñÊÇpostÓëget´«Öµ¶¼¿ÉÓÃ
string name = Request["name"].toString();

±íµ¥Ìá½»ÖÐgetºÍpost·½Ê½µÄÇø±ð¹éÄ ......

ASP.NET»·¾³µÄÅäÖÃ

½ñÌìÓÃÁË2¸öСʱµÄʱ¼äÀ´ÅäASP.NETµÄ»·¾³£¬ÓÐЩÈË¿ÉÄÜ»áÎÊ£¬ÎªÊ²Ã´ÐèÒªÕâô¾Ã£¬´ð°¸ºÜ¼òµ¥£¬ÒòΪÎÒµÄϵͳÊÇXPÉî¶ÈµÄ~ ËùÒÔ°²×°IISºÜ·Ñ¾¢£¬½ÓÏÂÀ´ÎÒÃèÊöÏÂÎÒÔõô°²×°µÄ¡£
ǰÌ᣺
1£©ÒѾ­°²×°ÁËVS2008£¬Õâ¸ö³ÌÐòÀïÃæÒѾ­´øÁË.NETµÄFramwork
²½Ö裨һ¶¨Òª¿´ÍêÎÒдµÄÔÙȥŪ£¡£¡£¡£©£º
1£©ÏÖÔÚµÄÈÎÎñÊÇÈ¥ÍøÉÏÏÂÔØÒ»¸öIIS5.Xµ ......

c# asp.net »ñÈ¡¿Í»§¶Ë±íµ¥µÄÊý¾Ý

ÔÚweb³ÌÐòÖУ¬¾­³£»áʹÓÃÔÚÒ»¸öÍøÒ³Ê¹ÓÃÆäËûÍøÒ³Ìá½»µÄÊý¾ÝÐÅÏ¢£¬ÕâÀï¿ÉÒÔʹÓÃRequestÄÚÖöÔÏóÀ´Íê³É£¬À´»ñÈ¡Óû§Ìá½»µÄÐÅÏ¢£¬¸ù¾Ý¿Í»§¶ËÌá½»Êý¾Ý·½Ê½µÄ²»Í¬£¬Request¶ÔÏó·Ö±ðʹÓÃFormºÍQueryString¼¯ºÏÊôÐÔÀ´»ñÈ¡Êý¾Ý¡£ÏÂÃæÊÇÁ½ÖÖ¼¯ºÏ»ñÈ¡·½Ê½µÄ²»Í¬µã£ºÍ¨¹ýForm»ñÈ¡Êý¾ÝʱÔÚformÊôÐÔÖмòµ¥µÄÌí¼Óaction=“Ìø×ªµÄÍøÒ³ ......

asp.net GridViewµÄһЩӦÓÃ

Ó¦ÓÃ1£ºGridViewºÍCheckBox½áºÏ
Ч¹ûͼ£º
Ó¦ÓÃ2£ºExtending the GridView Control
Code download available at: CuttingEdge05.exe (132 KB)
Browse the Code Online
 Contents
The GridView Difference
A New GridView Control
Adding a Checkbox Column
The New Grid In Action
Styling Selected ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ