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
Ïà¹ØÎĵµ£º
ÔÚASP.NETÖе¼³öexcel±í¹¦ÄÜ£¬ÔÚ±¾»úÉϵ÷ÊÔͨ¹ý£¬µ«ÊDz¿Êðµ½·þÎñÆ÷ÉÏʱ³ö´í¡£
´íÎóÐÅϢΪ
δÄܼÓÔØÎļþ»ò³ÌÐò¼¯“Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”»òËüµÄijһ¸öÒÀÀµÏϵͳÕÒ²»µ½Ö¸¶¨µÄÎļþ¡£
½â¾ö°ì·¨£º
1¡¢Ê¹ÓõĶ¯Ì¬¿â²»¶Ô
½«Web.ConfigÎÄ ......
Keys
ͼʾºÍ½âÊÍ
"> command" in Mini-buffer
£« ¿ÉÒÔÔÚÕâ¸ö´°ÌåÖÐÖ´ÐÐһЩÃüÁî±ÈÈç¹Ø±Õµ±Ç°´°¿ÚµÈµÈ
Ctrl-Shift-G in mini-buffer
Ctrl-O in mini-buffer
£« °´Ctrl-Shift-G ½«´ò¿ªobjects.cs Õâ¸öÎļþ Ctrl-O ´ò¿ªOpen¶Ô»°¿ò
Ctrl-Tab
Ctrl-Shift-Tab
£« Ctrl-Tab£ºÇл»µ±Ç°µÄ±à¼ÊÓͼ£¬Ctrl-Shift-Tab£º° ......
ASP.NET µÇ¼¿Ø¼þΪ ASP.NET Web Ó¦ÓóÌÐòÌṩÁËÒ»ÖÖ¿É¿¿µÄ¡¢ÎÞÐè±à³ÌµÄµÇ¼½â¾ö·½°¸¡£Ä¬ÈÏÇé¿öÏ£¬µÇ¼¿Ø¼þÓë ASP.NET ³ÉÔ±×ʸñºÍ Forms Éí·ÝÑéÖ¤¼¯³É£¬ÒÔ°ïÖúʵÏÖÍøÕ¾µÄÓû§Éí·ÝÑéÖ¤¹ý³ÌµÄ×Ô¶¯»¯¡£
ĬÈÏÇé¿öÏ£¬ASP.NET µÇ¼¿Ø¼þÒÔ´¿Îı¾ÐÎʽ¹¤×÷ÓÚ HTTP ÉÏ¡£Èç¹ûÄú¶Ô°²È«ÐÔÊ®·Ö ......
1.using gizp compress page ,gif file can't be compressed.
2.put script at the bottom,and put css at the top.
3.make the css and js external.
4.load-on-demand.(If a UI block need to show by control.Set visibable=false. and enableviewstate=true,override the saveviewstate method.)
5.remove the dupl ......
ASP.NETÖУ¬¾³£»áʹÓõ½templates(Ä£°æ)¹¦ÄÜ£¬±ÈÈçÔÚdatagrid£¬datalist£¬repeaterµÈ¿Ø¼þÖУ¬Ê¹ÓÃtemplates£¬½«»á´ó´óÔöÇ¿Æ书ÄÜ¡£ÒÔÍù£¬ÎÒÃÇÒ»°ãÊÇÔÚÉè¼Æ³ÌÐòʱ£¬¾ÍÒѾÉèÖúÿؼþÖеÄÄ£°æÊÇÔõÑùµÄÁË¡£µ«ÊÇ£¬ÓеÄʱºò£¬¿ÉÄÜÎÒÃÇÐèÒª¶¯Ì¬¼ÓÔØÄ£°æ£¬±ÈÈ磬µ±ÄãÒªÇóÄãµÄÓ¦ÓóÌÐòµÄ½çÃæ·ç¸ñËæ×ÅÓû§µÄÐèÇó¶ø±ä»¯Ê±£¬Äã¾ÍÐèÒ ......