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

asp.net responseдÎļþ

   protected void Button2_Click(object sender, EventArgs e)
    {      
      bool ok = true;
       string fileName;
        fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".doc";
        try
        {
            Response.ClearHeaders();
            Response.ContentType = "application/msword;";
            Response.Charset = "UTF-8";
            Response.AddHeader("Content-Disposition", string.Format("attachment;filename=\"{0}\"", fileName));
            Response.BinaryWrite(Encoding.Default.GetBytes(strr));
        }
        catch (Exception ex)
        {
            ok = false;
            Response.Write("Éú³ÉÎļþʧ°Ü£º" + ex.Message + "£¬ÇëÉÔºóÔÙÊÔ¡£");
            CreateGbpt(fileName, strr);
        }
        if (ok)
        {
            Response.End();
        }
   }
  private void CreateFile(string fileName, string text)
    {
        bool ok = true;
        string filePath;
  &


Ïà¹ØÎĵµ£º

ÔÚÁ½¸öASP.NETÒ³ÃæÖ®¼ä´«µÝ±äÁ¿

 ASP.NETÌṩÁËʼþÇý¶¯±à³ÌÄ£ÐÍ£¬Ê¹¿ª·¢Õß¼ò»¯ÁËÓ¦ÓóÌÐòµÄ×ÜÌåÉè¼Æ£¬µ«ÊÇÕâ¸öÒ²Ôì³ÉÁËËü¹ÌÓеÄһЩÎÊÌ⣬ÀýÈ磬ÔÚ´«Í³µÄASPÀÎÒÃÇ¿ÉÒÔͨ¹ýʹÓÃPOST·½·¨ºÜÈÝÒ×µØÊµÏÖÒ³Ãæ¼ä´«µÝ±äÁ¿£¬Í¬ÑùµÄÊÂÇ飬ÔÚʹÓÃʼþÇý¶¯±à³ÌÄ£Ð͵ÄASP.NET¾ÍÒªÂ鷳һЩ£¬µ«ÊÇÎÒÃÇÈÔÈ»ÓÐһЩ·½·¨¿ÉÒÔʵÏÖͬÑùµÄ¹¦ÄÜ¡£±ÊÕßÔÚÕâÀォ°üº¬Ê¹ÓÃque ......

ASP.NET³ÌÐòÖÐ Å׳ö"Thread was being aborted. "Òì³£

½ñÌìͻȻÓöµ½Õâ¸öÎÊÌâÁË£¡²»¹ýË¢ÐÂÒ³Ãæºó´íÎó¾ÍûÓУ¡ ¶øÇÒ֮ǰҲûÓÐÕâ¸ö´íÎóŶ£¡ ... ²»¹ýÎÒ»¹ÊÇÈ¥GoogleÁËһϴ𰸣¡
Thread was being aborted :ÖÐÎÄÒâ˼ Ï̱߳»ÖÕÖ¹
ÒýÓõØÖ·£ºhttp://support.microsoft.com/default.aspx/kb/312629/EN-US/?p=1
Ô­Òò£º
ÄǸö Response.End ·½·¨½áÊøÒ³µÄÖ´ÐУ¬²¢×ªÒƵ½Ö´ÐÐ µÄApplic ......

asp.net UpdatePanelµÄ¼òµ¥Ó÷¨

UpdatePanel¿ØÖÆÒ³ÃæµÄ¾Ö²¿¸üУ¬Õâ¸ö¸üй¦ÄÜÒÀÀµÓÚscriptManger¿Ø¼þµÄEnablePartialRenderingÊôÐÔ£¬Èç¹ûÕâ¸öÊôÐÔÉèÖÃΪfalse¾Ö²¿¸üлáʧȥ×÷ÓÃ(scriptManger¿Ø¼þµÄEnablePartialRenderingÊôÐÔµÄĬÈÏֵΪtrue²»±Ø¿ÌÒâÈ¥ÉèÖÃ)
ÏÂÃæÊÇÒ»¸öÍêÕûµÄUpdatePanelµÄ½á¹¹£º
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
<asp:ScriptManager  ......

ʹÓÃASP.NET Global.asax Îļþ

Global.asax Îļþ£¬ÓÐʱºò½Ð×ö ASP.NET Ó¦ÓóÌÐòÎļþ£¬ÌṩÁËÒ»ÖÖÔÚÒ»¸öÖÐÐÄλÖÃÏìÓ¦Ó¦ÓóÌÐò¼¶»òÄ£¿é¼¶Ê¼þµÄ·½·¨¡£Äã¿ÉÒÔʹÓÃÕâ¸öÎļþʵÏÖÓ¦ÓóÌÐò°²È«ÐÔÒÔ¼°ÆäËüһЩÈÎÎñ¡£ÏÂÃæÈÃÎÒÃÇÏêϸ¿´Ò»ÏÂÈçºÎÔÚÓ¦ÓóÌÐò¿ª·¢¹¤×÷ÖÐʹÓÃÕâ¸öÎļþ¡£
¸ÅÊö
Global.asax λÓÚÓ¦ÓóÌÐò¸ùĿ¼Ï¡£ËäÈ» Visual Studio .NET »á×Ô¶¯²åÈëÕ⸠......

ÔËÐÐASP.NET ³öÏÖ³ÌÐò´íÎó

½ñÌìÔÚ·þÎñÆ÷×°ºÃ .net Framework 3.5ºó£¬ÔËÐÐASP.NET ³öÏÖ³ÌÐò´íÎ󣬵«ÊÇÓÖûÓгöÏÖÌØ¶¨³ÌÐò´íÎó£¬Ëµ½Ð²é¿´ÈÕ¼ÇÎļþ£¬Ò»¿´£¬ËµÊ²Ã´ ³ÌÐòÓòÓÐÎÊÌ⣬°Ù¶ÈÖ®ºó£¬ºÜ¹ÜÓ㺠ӦÓóÌÐò³Ø -- ÊôÐÔ -- ±êʶ -- ¸Ä³É ±¾µØÏµÍ³  ÎÊÌâ½â¾ö¡£Ìش˼Ǽ¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ