Asp.NetÐÔÄÜÓÅ»¯
(Ò»).Ñ¡Ôñ»á»°×´Ì¬´æ´¢·½Ê½
ÔÚWebconfigÎļþÅäÖÃ:
<sessionState mode="???" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20"/>
Asp.netÓÐÈýÖÖ·½Ê½´æ´¢»á»°×´Ì¬ÐÅÏ¢:
1. ´æ´¢ÔÚ½ø³ÌÖÐ: ÊôÐÔmode = InProc
Ìص㣺 ¾ßÓÐ×î¼ÑµÄÐÔÄÜ£¬ËÙ¶È×î¿ì,µ«²»ÄÜ¿ç¶ą̀·þÎñÆ÷´æ´¢¹²Ïí.
2. ´æ´¢ÔÚ״̬·þÎñÆ÷ÖÐ: ÊôÐÔmode = "StateServer"
Ìصã: µ±ÐèÒª¿ç·þÎñÆ÷ά»¤Óû§»á»°ÐÅϢʱ£¬Ê¹Óô˷½·¨¡£
µ«ÊÇÐÅÏ¢´æ´¢ÔÚ״̬·þÎñÆ÷ÉÏ£¬Ò»µ©×´Ì¬·þÎñÆ÷³öÏÖ¹ÊÕÏ£¬ÐÅÏ¢½«¶ªÊ§
3. ´æ´¢ÔÚSql ServerÖÐ: ÊôÐÔmode="SqlServer"
Ìصã: ¹¤×÷¸ºÔØ»á±ä´ó£¬µ«ÐÅÏ¢²»»á¶ªÊ§.
²¹³äÒ»µã£º
I. ÓÉÓÚijЩҳÃæ²»ÐèÒª»á»°×´Ì¬£¬Ôò¿ÉÒÔ½«»á»°×´Ì¬½ûÓÃ:
´úÂëÈçÏ£º <%@ Page EnableSessionState="false" %>
II.Èç¹ûÒ³ÃæÐèÒª·ÃÎʻỰ±äÁ¿µ«²»ÔÊÐíÐÞ¸ÄËüÃÇ£¬¿ÉÒÔÉèÖÃÒ³Ãæ»á»°×´Ì¬ÎªÖ»¶Á:
´úÂëÈçÏ£º <%@ Page EnableSessionState="false" %>
ʹÓÃʱ¿ÉÒÔ¸ù¾Ý¾ßÌåÇé¿öÑ¡ÔñijÖÖ·½Ê½
(¶þ).ʹÓÃPage.IsPostBack
Page.IsPostBack±íʾÊÇ·ñÊÇ´Ó¿Í»§¶Ë·µ»ØµÄ. ³õ´ÎÔËÐÐʱ£¬²»ÊÇ´Ó¿Í»§¶Ë·µ»Ø£¬ËüµÄÖµ
Ϊfalse,µ±´¥·¢Ò³ÃæÉϵÄʼþ»òË¢ÐÂÒ³Ãæʱ£¬Page.IsPostBackÓÉÓÚÊǻط¢µÄ£¬Öµ±äΪ
Ïà¹ØÎĵµ£º
Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯
¡¡¡¡Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
¡¡¡¡·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕÊ ......
1.Á¬½ÓÊý¾Ý¿âÎļþ
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true" />
SqlConnectionStringBuilderʵÀý»¯Ê±£¬ÒªÓõ½connectionString£¬È磺SqlConnectionStringBuild builder = new SqlCon ......
±í¼ò½à
"¹«½»Ïß·Êý¾Ý¿â"
ÓõÄsqlÊý¾Ý¿â
admin±í
username
password
admin
admin
busroute ±í
³µ´Î
stop-name-id
Õ¾´Î
Ʊ¼Û
68
4
1
1
34
5
6
1.5
25
6
3
2
Õ¾µã±í
id
stop-name
1
»ð³µÕ¾
³µ´Î±í
id
³µ´Î
1
1
Èç¹ûÒªÓûùÓÚvb.netµÄasp.net±à³Ì
µÇ½µÄʱºò¸ÃÔõô±à³Ì°¡,Êý¾Ý¿âÊÇÓÃsql× ......
ÔÒò¾ÍÊÇIISºÍ.net Framework2.0°²×°Ë³Ðò·´ÁË£¬ÒòΪÎÒÏÈÇ°Ôø¾×°¹ýVisualStudio2005£¬ËùÒÔϵͳÀïÏÈ°²×°ÁË.net Framework2.0£¬¶øÕâÑùºóÀ´×°¹ýIISºó£¬.net Frameworkδע²áÏà¹Ø×é¼þ£¬²»ÄܶÔIIS×ö³öÐ޸ģ¬¾Í»á³öÏÖÕâÖÖÇé¿ö£¡
½â¾ö·½·¨£º
µ½C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727ÖÐÕÒ£¬Óиö¹¤¾ß½Ð aspnet_regiis.exe ......
Asp.NetÇå¿ÕÒ³ÃæËùÓÐtextboxµÄ¼¸ÖÖ·½·¨×ܽá
ÔÚAsp.NetÖÐÇå¿ÕËùÓÐtextboxÓкü¸ÖÖ·½·¨£¬±¾ÎÄÌṩ¼¸ÖÖ£¬¹©´ó¼Ò²Î¿¼£¡
foreach( Control childControl in this.Controls )
{
if( childControl is TextBox )
((TextBox)childControl).Text = "";
}&n ......