Asp.netÖзÀÖ¹Óû§¶à´ÎµÇ¼µÄ·½·¨
ÔÚweb¿ª·¢Ê±£¬ÓеÄϵͳҪÇóͬһ¸öÓû§ÔÚͬһʱ¼äÖ»ÄܵǼһ´Î£¬Ò²¾ÍÊÇÈç¹ûÒ»¸öÓû§ÒѾµÇ¼ÁË£¬ÔÚÍ˳ö֮ǰÈç¹ûÔٴεǼµÄ»°ÐèÒª±¨´í¡£
³£¼ûµÄ´¦Àí·½·¨ÊÇ£¬ÔÚÓû§µÇ¼ʱ£¬ÅжϴËÓû§ÊÇ·ñÒѾÔÚApplicationÖдæÔÚ£¬Èç¹û´æÔھͱ¨´í£¬²»´æÔڵĻ°¾Í¼Óµ½ApplicationÖÐ(ApplicationÊÇËùÓÐSession¹²Óеģ¬Õû¸öwebÓ¦ÓóÌÐòΨһµÄÒ»¸ö¶ÔÏó)£º
string strUserId = txtUser.Text;
ArrayList list = Application.Get("GLOBAL_USER_LIST") as ArrayList;
if (list == null)
{
list = new ArrayList();
}
for (int i = 0; i < list.Count; i++)
{
if (strUserId == (list[i] as string))
{
//ÒѾµÇ¼ÁË£¬Ìáʾ´íÎóÐÅÏ¢
lblError.Text = "´ËÓû§ÒѾµÇ¼";
return;
}
}
list.Add(strUserId);
Application.Add("GLOBAL_USER_LIST", list);
µ±È»ÕâÀïʹÓÃCacheµÈ±£´æÒ²¿ÉÒÔ¡£
½ÓÏÂÀ´¾ÍÊÇÒªÔÚÓû§Í˳öµÄʱºò½«´ËÓû§´ÓApplicationÖÐÈ¥³ý£¬ÎÒÃÇ¿ÉÒÔÔÚGlobal.asaxµÄSession_EndʼþÖд¦Àí£º
void Session_End(object sender, EventArgs e)
{
// ÔڻỰ½áÊøʱÔËÐеĴúÂë¡£
// ×¢Òâ: Ö»ÓÐÔÚ Web.config ÎļþÖÐµÄ sessionstate ģʽÉèÖÃΪ
// InProc ʱ£¬²Å»áÒý·¢ Session_End ʼþ¡£Èç¹û»á»°Ä£Ê½ÉèÖÃΪ StateServer
// »ò SQLServer£¬Ôò²»»áÒý·¢¸Ãʼþ¡£
string strUserId = Session["SESSION_USER"] as string;
ArrayList list = Application.Get("GLOBAL_USER_LIST") as ArrayList;
if (strUserId != null && list != null)
{
list.Remove(strUserId);
Application.Add("GLOBAL_USER_LIST", list);
}
}
ÕâЩ¶¼Ã»ÓÐÎÊÌ⣬ÓÐÎÊÌâµÄ¾ÍÊǵ±Óû§Ö±½Óµãä¯ÀÀÆ÷ÓÒÉϽǵĹرհ´Å¥Ê±¾ÍÓÐÎÊÌâÁË¡£ÒòΪֱ½Ó¹Ø±ÕµÄ»°£¬²¢²»»áÁ¢¼´´¥·¢Session¹ýÆÚʼþ£¬Ò²¾ÍÊǹرÕä¯ÀÀÆ÷ºóÔÙÀ´µÇ¼¾ÍµÇ²»½øÈ¥ÁË¡£
ÕâÀïÓÐÁ½ÖÖ´¦Àí·½Ê½£º
1¡¢Ê¹ÓÃJava£ó£ã£ò£é£ð£ô·½Ê½
ÔÚÿһ¸öÒ³ÃæÖмÓÈëÒ»¶Îjava£ó£ã£ò£é£ð£ô´úÂ룺
function window.onbeforeunload()
{
if (event.clientX>document
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://www.gisall.com/?uid-7232-action-viewspace-itemid-1300
ÓÉÓÚÓõ½ÁËÎļþÉÏ´«¹¦ÄÜ£¬¾Í²éÁËһϡ£Óм¸ÖÖ°ì·¨À´ÔÊÐí¿Í»§¶ËÉÏ´«Îļþ£º
1¡¢asp.net×Ô¼ºµÄfileupload¿Ø¼þ¡£È±µã£ºÖ»ÄÜÔÚpostback·½Ê½Ï¹¤×÷£¬¼´Ê¹·ÅÔÚupdatapanelÖÐÒ²±ØÐëË¢ÐÂÒ³Ãæ²ÅÐС£ÏÖÔÚŪ¸öË¢ÐÂÒ³ÃæµÄ¶«Î÷»áºÜûÃæ×Ó£¬ËùÒÔÒªÉÏajaxµÄ¡£ÏÂÃ漸¸ ......
Global.asax Îļþ£¬ÓÐʱºò½Ð×ö ASP.NET Ó¦ÓóÌÐòÎļþ£¬ÌṩÁËÒ»ÖÖÔÚÒ»¸öÖÐÐÄλÖÃÏìÓ¦Ó¦ÓóÌÐò¼¶»òÄ£¿é¼¶Ê¼þµÄ·½·¨¡£Äã¿ÉÒÔʹÓÃÕâ¸öÎļþʵÏÖÓ¦ÓóÌÐò°²È«ÐÔÒÔ¼°ÆäËüһЩÈÎÎñ¡£ÏÂÃæÈÃÎÒÃÇÏêϸ¿´Ò»ÏÂÈçºÎÔÚÓ¦ÓóÌÐò¿ª·¢¹¤×÷ÖÐʹÓÃÕâ¸öÎļþ¡£
¸ÅÊö
Global.asax λÓÚÓ¦ÓóÌÐò¸ùÄ¿ ......
Äú¿ÉÒÔ¾²Ì¬µØΪ TreeView ¿Ø¼þ´´½¨½Úµã -- ¼´ÔÚÉè¼Æʱ´´½¨¡£Èç¹ûÒª´´½¨¾ßÓй̶¨ÏîµÄÊ÷£¬ÕâÖÖ·½Ê½Ê®·ÖÓÐÓá£
˵Ã÷£º ²»ÄÜÒÔ¾²Ì¬·½Ê½¶¨Òå½Úµã£¬Ò²²»Äܽ«Êý¾Ý°ó¶¨µ½ TreeView ¿Ø¼þ¡£
Ò»¡¢ÔÚ TreeView ¿Ø¼þÖÐÌí¼Ó½Úµã
1¡¢ÔÚ“Éè¼Æ”ÊÓͼÖУ¬ÓÒ¼üµ¥»÷ TreeView ¿Ø¼þ£¬ÔÙµ ......
1. RepeaterÐèÒªÊÖ¶¯È¥°ó¶¨Êý¾Ý¡£ Òâ˼ÊÇ˵ÎÒÃÇÒªÔÚViewµ±ÖÐд ·þÎñ¶Ë´úÂ룬ÏÈ´ÓViewDataÖÐÈ¡µÃÊý¾Ý£¬ÔÙÈ¥°ó¶¨µ½Repeater¡£
2. Èç¹ûÒ»¸öÒ³ÃæÓõ½n+1¸öRepeater£¬Äǻ᲻»á·èµô£¿ ¶øÇÒÒª¸øÿһ¸öRepeaterÖ¸¶¨ Id£¬±ØÈ¥°óÊý¾Ý£¬Í·Í´°¡£¡£¡£¡
&nb ......
ASP.NETÖУ¬¾³£»áʹÓõ½templates(Ä£°æ)¹¦ÄÜ£¬±ÈÈçÔÚdatagrid£¬datalist£¬repeaterµÈ¿Ø¼þÖУ¬Ê¹ÓÃtemplates£¬½«»á´ó´óÔöÇ¿Æ书ÄÜ¡£ÒÔÍù£¬ÎÒÃÇÒ»°ãÊÇÔÚÉè¼Æ³ÌÐòʱ£¬¾ÍÒѾÉèÖúÿؼþÖеÄÄ£°æÊÇÔõÑùµÄÁË¡£µ«ÊÇ£¬ÓеÄʱºò£¬¿ÉÄÜÎÒÃÇÐèÒª¶¯Ì¬¼ÓÔØÄ£°æ£¬±ÈÈ磬µ±ÄãÒªÇóÄãµÄÓ¦ÓóÌÐòµÄ½çÃæ·ç¸ñËæ×ÅÓû§µÄÐèÇó¶ø±ä»¯Ê±£¬Äã¾ÍÐèÒ ......