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

ASP.NETÎļþÏÂÔØº¯Êý

ÔÚÄãµÄPage_LoadÖÐÌí¼ÓÕâÑùµÄ´úÂë:
 Page.Response.Clear();
 bool success = ResponseFile(Page.Request, Page.Response, "Ä¿µÄÎļþÃû³Æ", @"Ô´Îļþ·¾¶", 1024000);
 if (!success)
     Response.Write("ÏÂÔØÎļþ³ö´í£¡");
Page.Response.End();
ÎļþÏÂÔØº¯Êý´úÂëΪ:
public static bool ResponseFile(HttpRequest _Request,HttpResponse _Response,string _fileName,string _fullPath, long _speed)
    {
        try
        {
            FileStream myFile = new FileStream(_fullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
            BinaryReader br = new BinaryReader(myFile);
            try
            {
                _Response.AddHeader("Accept-Ranges", "bytes");
                _Response.Buffer = false;
                long fileLength = myFile.Length;
                long startBytes = 0;
     
                double pack = 10240; //10K bytes
                //int sleep 


Ïà¹ØÎĵµ£º

asp.net È¥µôviewstate

½â¾ö°ì·¨£ºapp_code/ ´æ·ÅÒ»¸öÀà ÓÃÀ´½Ø»ñHTTP
1.´úÂëÈçÏÂ
using System;
using System.IO;
using System.Web;
using System.Text;
using System.Text.RegularExpressions;
/// <summary>
/// Removes whitespace from the webpage.
/// </summary>
public class ViewstateModule : IHttpModule
{
......

asp.netÀûÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇ½µÄ´úÂë

Ðí¶à³ÌÐòÔ±ÔÚ×öÒµÎñ¿ª·¢Ê±ÍùÍù»áÔÚ·þÎñÆ÷¶Ë×öÓû§ÐÅÏ¢µÄÑéÖ¤£¬ÓÐûÓп¼ÂǹýÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇÂ½ÄØ£¿ÇÒЧ¹û±ÈÔÚ·þÎñÆ÷¶Ëд´úÂëÀ´ÑéÖ¤ºÃµÄ¶à£¬Ò³ÃæÎÞˢм´¿ÉʵÏÖʵÏֵǽÑéÖ¤£¬´úÂëÒ²¼òµ¥¡£
ÏÖÔÚÏÂÃæÌù³öÀ´µÄÊǺܼòµ¥µÄÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇ½µÄ´úÂ룬ÊʺϸսӴ¥jqueryµÄÅóÓÑѧϰ¡£
Ç°Ì¨Ò³Ãæ´úÂ룺
<he ......

asp.net Ò³Ãæ´«Öµ

Ö±½Ó»ñµÃÒ³Ãæ²ÎÊý£º
if(!IsPostBack) {   //ÅжÏÊÇ·ñÊǵÚÒ»´Î¼ÓÔØ´°Ìå
}
if(Page.PreviousPage!=null){                           // ÅжÏÉÏÒ»Ò³ÃæµÄ°´Å¥ÊÇ· ......

jQueryºÍASP.NET½áºÏʹÓÃ

ASP.NET AJAXÍÆ³öÒ²ÓÐÒ»¶Îʱ¼äÁË£¬µ±³õÐû³ÆµÄAJAX¿Í»§¶Ë½Å±¾¿ÉÒÔÍÑÀë·þÎñÆ÷¶Ë½Å±¾£¬ÔÚÖîÈçhtml,phpµÈƽ̨ÉÏʹÓ㬵«Ïñ΢Èí²»ÉÙÆäËû²úÆ·Ò»Ñù£¬Õâ¸ö·Ê´óµÄ£¬ÐÔÄܵÍÏ£¬ºÁÎÞÒÕÊõ¸ÐµÄ¿ò¼ÜÕýÔÚ±»´ó¼ÒËùÚ¸²¡¡£Ô½À´Ô½¶àµÄÈËÏëÒªÍÑÀëÕâ¸ö¿Í»§¶Ë½Å±¾£¬ÍÑÀëAJAXÌṩµÄ¿Í»§¶Ë¿Ø¼þ£¬Óøü¾«Á¶¸ü¸ßЧµÄ¿ò¼ÜÀ´µ÷Ó÷þÎñÆ÷¶Ë·½·¨¡£ºÜÏÔÈ»£¬Ä¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ