ASP.NET ÉúÃüÖÜÆÚ
ASP.NET ÉúÃüÖÜÆÚ
¶ÔÓÚAsp.netÒ³Ãæ²ã¿ª·¢ÎÞÂÛÊÇдҳÃ滹ÊÇд¿Ø¼þ£¬ÎÒ¾õµÃ¶¼¿ÉÒÔÓÃÒ»¾ä»°ÃèÊö:"Do the right thing at the right time in the right place."
±¾ÎÄͨ¹ý¼Ç¼ҳÃæʼþµÄ´¥·¢Ë³Ðò¿´ÇëÇóµÄ´¦ÀíÁ÷³Ì£¬´ÓÖпÉÒÔ¿´³öASP.NET µÄÉúÃüÖÜÆÚ
´´½¨Ò»¸öÍøÕ¾£¬ÔÚÒ³ÃæÉÏÌí¼ÓÒ»¸öLabelºÍÒ»¸öButton£¬ÔÚDefault.aspx.csÖÐÐ޸ĴúÂëÈçÏ£º
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_PreInit(object sender, EventArgs e)
{
Response.Write("Page_PreInit<br/>");
}
protected void Page_Init(object sender, EventArgs e)
{
Response.Write("Page_Init<br/>");
}
protected void Page_InitComplete(object sender, EventArgs e)
{
Response.Write("Page_InitComplete<br/>");
}
protected void Page_PreLoad(object sender, EventArgs e)
{
Response.Write("Page_PreLoad<br/>");
}
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Page_Load<br/>");
}
protected void Page_LoadComplete(object sender, EventArgs e)
{
Response.Write("Page_LoadComplete<br/>");
}
protected void Page_PreRender(object sender, EventArgs e)
{
Response.Write("Page_PreRender<br/>");
}
protected void Page_PreRenderComplete(object sender, EventArgs e)
{
Response.Write("Page_PreRenderComplete<br/>");
}
protected void Page_SaveStateComplete(object sender, EventArgs e)
{
Response.Write("Page_SaveStateComplete<br/>");
}
protected void Page_Unload(object sender, EventArgs e)
{
int i = 0;
i++; ////ÕâÐдúÂëÊÇÓÃÀ´ÉèÖöϵãµÄ
}
//p
Ïà¹ØÎĵµ£º
ÔÚgridviewÖÐ
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<asp:TemplateField HeaderText="Remove">
&nbs ......
˳±ãÌáÒ»ÏÂaspÖÐSessionµÄ¹¤×÷ÔÀí£º
aspµÄSessionÊǾßÓнø³ÌÒÀÀµÐԵġ£ASP Session״̬´æÓÚIISµÄ½ø³ÌÖУ¬Ò²¾ÍÊÇinetinfo.exeÕâ¸ö³ÌÐò¡£ËùÒÔµ±inetinfo.exe½ø³Ì±ÀÀ£Ê±£¬ÕâЩÐÅÏ¢Ò²¾Í¶ªÊ§¡£ÁíÍ⣬ÖØÆð»òÕ߹رÕIIS·þÎñ¶¼»áÔì³ÉÐÅÏ¢µÄ¶ªÊ§¡£
asp.net SessionµÄʵÏÖ
asp.netµÄSessionÊÇ»ùÓÚHttpModule¼¼Êõ×öµÄ£¬HttpModule ......
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient; ......
ÎÊ£ºÎªÊ²Ã´SessionÔÚÓÐЩ»úÆ÷ÉÏż¶û»á¶ªÊ§£¿
´ð£º¿ÉÄܺͻúÆ÷µÄ»·¾³ÓйØϵ£¬±ÈÈ磺·À»ðǽ»òÕßɱ¶¾Èí¼þµÈ£¬³¢ÊԹرշÀ»ðǽ¡£
ÎÊ£ºÎªÊ²Ã´µ±µ÷ÓÃSession.Abandonʱ²¢Ã»Óм¤·¢Session_End·½·¨£¿
´ð£ºÊ×ÏÈSession_End·½·¨Ö»Ö§³ÖInProc£¨½ø³ÌÄڵģ©ÀàÐ͵ÄSession¡£Æä´ÎÒª¼¤·¢Session_End·½·¨£¬±ØÐë´æÔÚSession£¨¼´ÏµÍ³ÖÐÒÑ¾Ê¹Ó ......