asp.net(c#) static¹Ø¼ü×ÖÓ÷¨Ð¡½á[zz]
http://ayic1.blog.163.com/blog/static/27343030200965103528805/
¾²Ì¬±äÁ¿
µ±ÎÒÃDZàдһ¸öÀàʱ£¬Æäʵ¾ÍÊÇÔÚÃèÊöÆä¶ÔÏóµÄÊôÐÔºÍÐÐΪ£¬¶ø²¢Ã»ÓвúÉúʵÖÊÉϵĶÔÏó£¬Ö»ÓÐͨ¹ýnew¹Ø¼ü×ֲŻá²úÉú³ö¶ÔÏó£¬Õâʱϵͳ²Å»á·ÖÅäÄÚ´æ¿Õ¼ä¸ø¶ÔÏó£¬Æä·½·¨²Å¿ÉÒÔ¹©Íⲿµ÷Óá£
ÓÐʱºò£¬ÎÒÃÇÏ£ÍûÎÞÂÛÊÇ·ñ²úÉúÁ˶ÔÏó»òÎÞÂÛ²úÉúÁ˶àÉÙ¶ÔÏóµÄÇé¿öÏ£¬Ä³Ð©Ìض¨µÄÊý¾ÝÔÚÄÚ´æ¿Õ¼äÀïÖ»ÓÐÒ»·Ý£¬ÀýÈçËùÓеÄÖйúÈ˶¼Óйú¼ÒÃû³Æ£¬Ã¿Ò»¸öÖйúÈ˶¼¹²ÏíÕâ¸ö¹ú¼ÒÃû³Æ£¬²»±ØÔÚÿһ¸öÖйúÈ˵ÄʵÀý¶ÔÏóÖж¼µ¥¶À·ÖÅäÒ»¸öÓÃÓÚ´úÂë¹ú¼ÒÃû³ÆµÄ±äÁ¿¡£Àý×Ó£º
protected void Page_Load(object sender, EventArgs e)
{
//Ö±½ÓʹÓÓÀàÃû.³ÉÔ±”µÄ¸ñʽ£¬²»ÄÜʹÓÓ¶ÔÏóÃû.³ÉÔ±”µÄ¸ñʽ£¬ÕâµãÓëJAVA²»Ò»Ñù£¬JAVAÁ½ÖÖ¶¼¿ÉÒÔʹÓÃ
Response.Write(Chinese.Country);
}
class Chinese
{
public static string Country = "Öйú";
public void getCountry()
{
//ÀàÖеijÉÔ±·½·¨Ò²¿ÉÒÔÖ±½Ó·ÃÎʾ²Ì¬³ÉÔ±±äÁ¿
HttpContext.Current.Response.Write("ÄãºÃ£¡" + Country);
}
}
ÐèҪעÒâµÄÊÇ£º²»ÄÜ°ÑÈκη½·¨ÌåÄڵıäÁ¿ÉùÃ÷Ϊ¾²Ì¬£¬ÈçÏÂÃæÕâÑùÊDz»Ðеģº
public void getCountry()
{
//ÀàÖеijÉÔ±·½·¨Ò²¿ÉÒÔÖ±½Ó·ÃÎʾ²Ì¬³ÉÔ±±äÁ¿
HttpContext.Current.Response.Write("ÄãºÃ£¡" + Country);
static int i = 1;
}
¾²Ì¬·½·¨
ÎÒÃÇÓÐʱҲϣÍû²»±Ø´´½¨¶ÔÏó¾Í¿ÉÒÔµ÷ÓÃij¸ö·½·¨£¬»»¾ä»°ËµÒ²¾ÍÊÇʹ¸Ã·½·¨²»±ØºÍ¶ÔÏó°ó¶¨ÔÚÒ»Æð¡£ÒªÊµÏÖÕâÑùµÄЧ¹û£¬Ö»ÐèÒªÔÚÀàÖж¨ÒåµÄ·½·¨Ç°¼ÓÉÏstatic¹Ø¼ü×־ͿÉÒÔÁË£¬ÎÒÃdzÆÕâÖÖ·½·¨Îª¾²Ì¬³ÉÔ±·½·¨£¬»¹¿ÉÒÔÔÚÀàµÄ·Ç¾²Ì¬³ÉÔ±·½·¨ÖÐÏó·ÃÎÊÆäËû¾²Ì¬·½·¨Ò»ÑùÈ¥·ÃÎÊÕâ¸ö¾²Ì¬·½·¨£¬Àý×Ó£º
prot
Ïà¹ØÎĵµ£º
1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯¡¡
¡¡
Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕÊ±Ê ......
1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯¡¡
¡¡
Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕÊ±Ê ......
ASP.NET MVCºÍWebForm¸÷Óи÷µÄÓŵ㣬ÎÒÃÇ¿ÉÄÜÐèҪͬʱʹÓÃASP.NET MVCºÍWebForm¡£±¾ÎĽéÉÜÁËÈçºÎÔÚASP.NET MVCÏîÄ¿ÖÐʹÓÃWebForm¡£
Ê×ÏÈн¨Ò»¸öÃûΪWebFormsµÄÎļþ¼ÐÓÃÓÚ´æ·ÅWebForm£¬²¢Ìí¼ÓÒ»¸öWeb´°ÌåÎļþDemo.aspx×÷ΪÑÝʾ¡£
Demo.aspx¾Í¼òµ¥µÄÊä³öÒ»¾ä»°“It’s a WebForm.”
¹Ø¼ü²½ÖèÔÚÓÚ·ÓÉÉèÖá ......
֮ǰÓöµ½Ò»¸öºÜÓôÃƵÄÎÊÌ⣬ ´ó¸Å¾ÍÊÇdagagridÀïÓ¦ÓÃÁËÒ»¸öÐÐÊÇcheckbox£¬ ½á¹ûËÀ»îµãcheck all£¬ submitÒÔºó Response.FormÀïµÄidºÍ FindControlÀïÕÒµ½µÄ²»Ò»ÖÂÁË.
½áÂÛÊÇ:
datagrid °ó¶¨ÒÔºóÔÙÒ²²»Òª¶¯ÁË! ·ñÔò ǰ̨id ÔÙpostback µÄʱºòÊDz»Ò»Ö嵀 ......
net 2.0ÖеÄпؼþReportViewer¿ÉÒÔ·½±ãµÄÖÆ×÷²¢ÏÔʾ±¨±í£¬µ«ÊÇËüûÓÐÖ±½ÓÖ§³ÖÔÚÍøÒ³ÖеĴòÓ¡¡£ÎÒÔÚ·ÖÎöÍøÒ³HTMLÔ´´úÂëµÄ»ù´¡ÉÏÕÒµ½ÁËÖ±½Ó´òÓ¡µÄ¾÷ÇÏ£¬ÏÈ×ö³ÉÒ»¸öº¯Êý£¬·½±ãÖ±½ÓʹÓá£
1.°üº¬ReportViewer±¨±íµÄÍøÒ³µÄ×îÖÕÐÎʽHTML DOM½á¹¹ÖУ¬±¨±í±»·Åµ½Ò»¸ö<iframe>ÖУ¬ÆäidÃüÃû·½Ê½Îª£º ......