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.
Ïà¹ØÎĵµ£º
ASP.NET 2.0
Îļþ£±: Deafault.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&l ......
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["BackUrl"] = Request.UrlReferrer.ToString();
}
}
/// <summary>
/// ·µ»Ø°´Å¥µã»÷ʼþ
/// </summary& ......
Ò»¡¢SqlDataReadºÍDatasetµÄÑ¡Ôñ
SqldatareadÓŵ㣺¶ÁÈ¡Êý¾Ý·Ç³£¿ì¡£Èç¹û¶Ô·µ»ØµÄÊý¾Ý²»Ðè×ö´óÁ¿´¦ÀíµÄÇé¿öÏ£¬½¨ÒéʹÓÃSqlDataReader£¬ÆäÐÔÄÜÒª±ÈdatsetºÃºÜ¶à¡£È±µã£ºÖ±µ½Êý¾Ý¶ÁÍê²Å¿ÉcloseµôÓÚÊý¾Ý¿âµÄÁ¬½Ó
(SqlDataReader ¶ÁÊý¾ÝÊÇ¿ìËÙÏòÇ°µÄ¡£SqlDataReader ÀàÌṩÁËÒ»ÖÖ¶ÁÈ¡´Ó SQL Server
Êý¾Ý¿â¼ìË÷µÄÖ»½øÊý¾ÝÁ÷µ ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......
ÈÏʶASP.NETÅäÖÃÎļþWeb.config
¡¡¡¡Ò»¡¢ÈÏʶWeb.configÎļþ
¡¡¡¡Web.configÎļþÊÇÒ»¸öXMLÎı¾Îļþ£¬ËüÓÃÀ´´¢´æ ASP.NET Web Ó¦ÓóÌÐòµÄÅäÖÃÐÅÏ¢(Èç×î³£ÓõÄÉèÖÃASP.NET Web Ó¦ÓóÌÐòµÄÉí·ÝÑéÖ¤·½Ê½)£¬Ëü¿ÉÒÔ³öÏÖÔÚÓ¦ÓóÌÐòµÄÿһ¸öĿ¼ÖС£µ±Äãͨ¹ýVB.NETн¨Ò»¸öWebÓ¦ÓóÌÐòºó£¬Ä¬ÈÏÇé¿öÏ»áÔÚ¸ùĿ¼×Ô¶¯´´½¨Ò»¸öĬÈ쵀 ......