asp.net ÏÂʵÏÖÎļþÉÏ´«½ø¶ÈÌõ£¨IHttpModule£©
±¾ÎĽ«Ì½ÌÖasp.netÏÂʵÏÖÎļþÉÏ´©½ø¶ÈÌõµÄ·½·¨¡£
Ò»°ãÇé¿öÏ£¬ÒªÊµÏÖÉÏ´«½ø¶ÈÌõÊ×ÏÈҪʵÏÖÉÏ´«Îļþ·Ö¿é¶ÁÈ¡£¬¶øĬÈÏÇé¿öÏ£¬iis½«Ö±½Ó°ÑÉÏ´«µÄÎļþÒ»´Î¶ÁÈëµ½ÄÚ´æÖУ¬ËùÒÔ±¾´¦µÄÄѵãÔÚÓÚÀ¹½ØiisµÄÎļþÉÏ´«¹ý³Ì£¬×ª¶ø×Ô¼ºµÄʵÏÖ·½Ê½¡£ËùÒÔ£¬ÎÒÃÇ¿ÉÒÔʵÏÖÒ»¸öIHttpModuleÀ´´¦ÀíÉÏ´«¹ý³Ì¡£¾ßÌåµÄ¹ý³ÌÊÇApplication_BeginRequestϵõ½µ±Ç°µÄHttpWorkRequest£¬È»ºóͨ¹ýÕâ¸ö¶ÔÏóÀ´µÃµ½µ±Ç°ÇëÇóµÄÀàÐÍ£¬³¤¶È¡£¾ßÌå·½·¨Çë²é¿´ÀàµÄʵÏÖ´úÂ루¸ÃÀàÀ´×ÔÓÚ»¥ÁªÍø£©¡£
ÓÉÓÚÔÚÀàÖÐÒѾÓбȽÏÍêÕûµÄ×¢ÊÍ£¬ËùÒÔÎÒÖ»½éÉÜÒ»¸öÁ÷³Ì£¬Ã»ÓÐÉæ¼°µ½¾ßÌåµÄ·½·¨¡£
ÎÒÃÇ¿ÉÒÔÖªµÀ£¬Èç¹ûÎÒÃÇÈ¡µÃÁË×ܵij¤¶È£¬ÄÇÎÒÃǾͿÉÒÔÉèÖÃÒ»¸ö¹Ì¶¨µÄ³¤¶È£¨±ÈÈç1024×Ö½Ú£©£¬È»ºóÉèÖÃÒ»¸öÑ»·À´Ã¿´Î¶ÁÈ¡ÕâЩÊý¾Ý£¬ÕâÑù£¬ÎÒÃǾͿÉÒԵõ½µ±Ç°×ܹ²¶ÁÈ¡µÄÄÚÈݳ¤¶È¡£ÄÇÒ³ÃæÉÏÈçºÎµÃµ½µ±Ç°µÄ½ø¶ÈÄØ£¿ÀûÓÃappliaction¶ÔÏóÀ´´æ´¢Êý¾Ý£¬ÕâÑù£¬Ç°Ì¨µÄÒ³ÃæÒ²¿ÉÒÔʹÓÃapplicationÀ´µÃµ½µ±Ç°µÄ½ø¶È¡£ÒòΪapplicationҪʹÓÃÒ»¸ö¼üÀ´È·¶¨ÊÇÄĴεÄÊý¾Ý£¬³£Óõķ½·¨ÊÇ£¬ihttpmoduleÖÐͨ¹ýrequestÀ´È¡µÃÕâ´ÎµÄ¼üÖµ£¬¶øÉÏ´«ÎļþҲͬÑùÓµÓÐÕâÑùÒ»¸ö¼üÖµ¡£Òò´ËÔÚupload.aspxÖеÄpage_loadÖÐÐèÒª£º
this.UploadID = this.Request["UploadID"];
if (this.UploadID == null)
this.Response.Redirect("~/user/uploadphotos.aspx?UploadID=" + Guid.NewGuid().ToString()+
"&itemid="+this.itemid.ToString (), true);
Èç¹ûµÚÒ»´Î½øÈ룬¾ÍÖØÐÂת·¢µ½ÕâÕÅÒ³Ã棬²¢¸øËûÒ»¸öuploadid£¬Í¬Ê±ÔÚHttpUploadModuleÖУº
string uploadId = app.Request.QueryString["UploadID"];//ͬ²½È¡µÃÕâ¸öuploadid
ÄÇÈçºÎÀ´ÊµÊ±¶ÁÈ¡Õâ¸öÊý¾Ý²¢ÏÔʾÔÚÒ³ÃæÖÐÄØ£¿
ÎÒÃÇ¿ÉÒÔÔÚupload.aspxÖÐʹÓÃxmlhttpȥѻ·ÇëÇóÒ»¸öprogress.aspx£¨Õâ¸öÒ³ÃæÀ´¶ÁÈ¡applicationÖеÄÊý¾Ý£©¡£
µ±È»£¬ÔÚasp.netÖÐÎÒÃÇ»¹¿ÉÒÔʹÓÃasp.net ajaxÀ´ÊµÏÖÕâÒ»¹ý³Ì£¬¾ßÌå·½·¨ÊÇ£º
½¨Á¢Ò»¸öwebservicesÀ´¶ÁÈ¡applicationÖеÄÊý¾Ý£»
ÔÚajaxÖÐÀ´·ÃÎÊÕâ¸öservice£»
ÈçÏÂwebservices¶Ë´úÂ룺
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using adow.adup.
Ïà¹ØÎĵµ£º
CTRL + SHIFT + BÉú³É½â¾ö·½°¸
CTRL + F7 Éú³É±àÒë
CTRL + O ´ò¿ªÎļþ
CTRL + SHIFT + O´ò¿ªÏîÄ¿
CTRL + SHIFT + CÏÔʾÀàÊÓͼ´°¿Ú
F4 ÏÔʾÊôÐÔ´°¿Ú
SHIFT + F4ÏÔʾÏîÄ¿ÊôÐÔ´°¿Ú
CTRL + SHIFT + EÏÔʾ×ÊÔ´ÊÓͼ
F12 תµ½¶¨Òå
CTRL + F12תµ½ÉùÃ÷
CTRL + ALT + J¶ÔÏóä¯ÀÀ
CTRL + ALT + F1°ïÖúĿ¼
CTR ......
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["BackUrl"] = Request.UrlReferrer.ToString();
}
}
/// <summary>
/// ·µ»Ø°´Å¥µã»÷ʼþ
/// </summary& ......
1.ǰ̨ҳÃæÒ»°ã²»ÓÃgridview datalist treeview updatepanel µÈ¿Ø¼þ£¬ÒòΪËûÃÇ»áÉú³ÉºÜ¶àÎÒ²»ÏëÒªµÄ´úÂë¡£¶øÇÒǶÌ×Ò»´ó¶Ñtable
2.ÓÃrepeater+div+css+ul liÒѾ×ã¹»ÎÒ×öºÜ¶à¶«Î÷ÁË¡£
3.·¢²¼ºóµÄÒ³Ã棬¿ÉÒÔ°ÑһЩ¿ÕÐкͻ»ÐÐ ºÍһЩ²»±ØÒªµÄ¿Õ¸ñÈ¥µô£¬¾¡Á¿¼õÉÙaspxÒ³ÃæµÄÈÝÁ¿¡£Ìá¸ß¼ÓÔØËٶȡ£
4.ÔÚÒ³ÃæµÄtitleдÉϱ¾Ò³ÄÚÈÝ ......
“<%#....%>” ÕâÊÇÊý¾Ý°ó¶¨£¬ÀïÃæ¿ÉÒÔµ÷ÓÃC#µÄ·½·¨¡£
“<%$....%>" û¼û¹ýÕâ¸ö¡£
“<%@...%>”Õâ¸öÊÇÒ³ÃæÖ¸Áһ°ã·ÅÔÚÿ¸öÒ³ÃæµÄ×²¿£¬¶ÔÒ³ÃæµÄÔËÐнøÐпØÖÆ£¬ÈçÉèÖûº´æ£¬ÒýÓÃÓû§¿Ø¼þ£¬µ¼ÈëÃüÃû¿Õ¼ä==
ÁíÍ⻹ÓÐÒ»¸ö<%= ...%> Õâ¸ö=ºÅºóÒ²¿ÉÒÔµ÷ÓÃC#µÄ·½· ......
ÕâÊÇҪʵÏֵŦÄÜ£º
µÚÒ»²½£ºÍÏÈëGridView¿Ø¼þ ²¢ÇÒÍê³É²éѯËùÓÐÊý¾ÝµÄ·½·¨ ͨ¹ýthis.GridView1.DataSource »ñÈ¡¼¯ºÏÊý¾Ý GridView1.DataBind() °ó¶¨Êý¾Ý
µÚ¶þ²½£ºÊµÏÖÈ«Ñ¡¹¦ÄÜ
1. Ò³Ãæ´úÂ룺
´úÂë
<asp:TemplateField HeaderText="È«Ñ¡">
&nbs ......