ASP.NETµ×²ãµÄ³õ²½ÈÏʶÓëÀí½â
×î½üÔÚ¹úÍâµÄÍøÕ¾ÂÒ×ßһͨ£¬·¢ÏÖһЩ±È½ÏºÃµÄÎÄÕ£¬ÊÕ¼¯ÕûÀí¼ÓÓÚ×Ô¼ºµÄÀí½â£¬×÷Ϊ±Ê¼ÇÐÎʽ¼Ç¼ÏÂÀ´£¬ÈÃÒÔºó×Ô¼ºÓиö»ØÒä¡£
¡¡¡¡ASP.NETÊÇÒ»¸ö·Ç³£Ç¿´óµÄ¹¹½¨WebÓ¦ÓõÄƽ̨,ËüÌṩÁ˼«´óµÄÁé»îÐÔºÍÄÜÁ¦ÒÔÖÂÓÚ¿ÉÒÔÓÃËüÀ´¹¹½¨ËùÓÐÀàÐ͵ÄWebÓ¦ÓÃ.¾ø´ó¶àÊýµÄÈËÖ»ÊìϤ¸ß²ãµÄ¿ò¼ÜÈçWebFormsºÍWebServices-ÕâЩ¶¼ÔÚASP.NET²ã´Î½á¹¹ÔÚ×î¸ß²ã.ÔÚÕâƪÎÄÕÂÖÐÎÒ½«»áÌÖÂÛASP.NETµÄµ×²ã»úÖƲ¢½âÊÍÇëÇó(request)ÊÇÔõô´ÓWeb·þÎñÆ÷´«Ë͵½ASP.NETÔËÐÐʱȻºóÈçºÎͨ¹ýASP.NET¹ÜµÀÀ´´¦ÀíÇëÇó.
¡¡¡¡ASP.NETÊÇÒ»¸öÇëÇó´¦ÀíÒýÇæ.Ëü½ÓÊÕÒ»¸ö·¢Ë͹ýÀ´µÄÇëÇó,°ÑËü´«¸øÄÚ²¿µÄ¹ÜµÀÖ±µ½ÖÕµã,×÷Ϊһ¸ö¿ª·¢ÈËÔ±µÄÄã¿ÉÒÔÔÚÕâÀ︽¼ÓһЩ´úÂëÀ´´¦ÀíÇëÇó.Õâ¸öÒýÇæÊǺÍHTTP/Web·þÎñÆ÷ÍêÈ«·Ö¸ôµÄ.ÊÂʵÉÏ,HTTPÔËÐÐʱÊÇÒ»¸ö×é¼þ,ʹÄã¿ÉÒÔ°ÚÍÑIIS»òÕßÈκÎÆäËûµÄ·þÎñÆ÷³ÌÐò,½«Äã×Ô¼ºµÄ³ÌÐò¼ÄËÞÔÚÄÚ.
¡¡¡¡ÔËÐÐʱÌṩÁËÒ»¸ö¸´ÔÓµ«Í¬Ê±·Ç³£ÓÅÑŵÄÔڹܵÀÖзÓÉÇëÇóµÄ»úÖÆ.ÆäÖÐÓкܶàÏà¹ØµÄ¶ÔÏó,´ó¶àÊý¶¼ÊÇ¿ÉÀ©Õ¹µÄ(ͨ¹ý¼Ì³Ð»òÕßʼþ½Ó¿Ú),ÔÚ¼¸ºõËùÓеĴ¦ÀíÁ÷³ÌÉ϶¼ÊÇÈç´Ë.ËùÒÔÕâ¸ö¿ò¼Ü¾ßÓи߶ȿÉÀ©Õ¹ÐÔ.ͨ¹ýÕâ¸ö»úÖÆ,¹Ò½Óµ½·Ç³£µ×²ãµÄ½Ó¿Ú(±ÈÈ绺´æ,ÈÏÖ¤ºÍÊÚȨ)¶¼±äµÃ¿ÉÄÜÁË.ÄãÉõÖÁ¿ÉÒÔÔÚÔ¤´¦Àí»òÕß´¦Àíºó¹ýÂËÄÚÈÝ,Ò²¿ÉÒÔ¼òµ¥µÄ½«·ûºÏÌØÊâ±ê¼ÇµÄÇëÇóÖ±½Ó·ÓÉÄãµÄ´úÂë»òÕßÁíÒ»¸öURLÉÏ.´æÔÚ×ÅÐí¶à²»Í¬µÄ·½·¨À´Íê³Éͬһ¼þÊÂ,µ«ÊÇËùÓÐÕâЩ·½·¨¶¼ÊÇ¿ÉÒÔ¼òµ¥Ö±½ÓµØʵÏÖµÄ,ͬʱ»¹ÌṩÁËÁé»îÐÔ,¿ÉÒԵõ½×îºÃµÄÐÔÄܺͿª·¢µÄ¼òµ¥ÐÔ.
¡¡¡¡Õû¸öASP.NETÒýÇæÊÇÍêÈ«½¨Á¢ÔÚÍйܴúÂëÉϵÄ,ËùÓеÄÀ©Õ¹¹¦ÄÜÒ²ÊÇͨ¹ýÍйܴúÂëÀ©Õ¹À´ÌṩµÄ.ÕâÊǶÔ.NET¿ò¼Ü¾ßÓй¹½¨¸´ÔÓ¶øÇÒ¸ßЧµÄ¿ò¼ÜµÄÄÜÁ¦µÄ×îºÃµÄÖ¤Ã÷.ASP.NET×îÁîÈËÓ¡ÏóÉî¿ÌµÄµØ·½ÊÇÉî˼ÊìÂǵÄÉè¼Æ,ʹµÃ¿ò¼Ü·Ç³£µÄÈÝÒ×ʹÓÃ,ÓÖÄÜÌṩ¹Ò½Óµ½ÇëÇó´¦ÀíµÄ¼¸ºõËùÓв¿·ÖµÄÄÜÁ¦.
¡¡¡¡ASP.NETÔÚ΢ÈíµÄƽ̨ÉϾÍÊÇͨ¹ýISAPIÀ©Õ¹À´ºÍIIS½øÐн»»¥µÄ,Õâ¸öÀ©Õ¹¼ÄËÞ×Å.NETÔËÐÐʱºÍASP.NETÔËÐÐʱ.ISAPIÌṩÁ˺ËÐĵĽӿÚ,ASP.NETʹÓ÷ÇÍйܵÄISAPI´úÂëͨ¹ýÕâ¸ö½Ó¿ÚÀ´´ÓWeb·þÎñÆ÷»ñÈ¡ÇëÇó,²¢·¢ËÍÏìÓ¦»Ø¿Í»§¶Ë.ISAPIÌṩµÄÄÚÈÝ¿ÉÒÔͨ¹ýͨÓöÔÏó(ÀýÈçHttpRequestºÍHttpResponse)À´»ñÈ¡,ÕâЩ¶ÔÏóͨ¹ýÒ»¸ö¶¨ÒåÁ¼ºÃ²¢Óкܺ÷ÃÎÊÐԵĽӿÚÀ´±©Â¶·ÇÍйÜÊý¾Ý.
¡¡¡¡µ±Óû§·¢ËÍÒ»¸öURLÇëÇóʱ£¬ÔÚWeb·þÎñÆ÷¶Ë,IIS5»ò6,»ñµÃÕâ¸öÇëÇó.ÔÚ×îµ×²ã,ASP.NETºÍIISͨ¹ýISAPIÀ©Õ¹½øÐн»»¥.ÔÚASP.NET»·¾³ÖÐÕâ¸öÇëÇóͨ³£±»Â·Óɵ½Ò»¸öÀ©Õ¹ÃûΪ.aspxµÄÒ³ÃæÉÏ,µ«ÊÇÕâ¸öÁ÷³ÌÊÇÔõô¹¤×
Ïà¹ØÎĵµ£º
½ñÌìÔÚ×öÒ»¸öÎÞË¢ÐÂÅжϹ«Ë¾Ãû³Æ£¬ÊÇ·ñÖظ´µÄʱºò£¬·¢ÏÖÒ»¸öÎÊÌâ¾ÍÊÇͨ¹ýjavascript´«µ½asp.netÒ³ÃæµÄÖµÊÇÂÒÂë¡£ÒÔǰûÓз¢ÏÖ¡£ÒòΪ ÒÔÇ°×ö²âÊÔʱ£¬¶¼ÊÇÓÃÓ¢ÎÄ×Ö·û½øÐеIJâÊÔ¡£½ñÌìÊäÈ뺺×ֺ󣬷¢ÏÖÓÐÕâÖÖÎÊÌâ¡£¸Ð¾õ¿ÉÄÜÊDZàÂëµÄÎÊÌâ¡£¾ÍÉÏÍø²éÁËһϡ£ÕÒµ½Ò»Ð©·½·¨£¬ÈçÏ£º
1.ÉèÖÃweb.configÎļþ
<system.web>
&l ......
²»ÒªÊ¹Óò»±ØÒªµÄSession£¬ºÍASPÖÐÒ»Ñù£¬ÔÚ²»±ØÒªµÄʱºò²»ÒªÊ¹ÓÃSession
²»Ê¹Óò»±ØÒªµÄServer Control
²»Ê¹Óò»±ØÒªµÄViewState
²»ÒªÓÃException¿ØÖƳÌÐòÁ÷³Ì
½ûÓÃVBºÍJscript¶¯Ì¬Êý¾ÝÀàÐÍ
ʹÓô洢¹ý³ÌÍê³ÉÊý¾Ý·ÃÎÊ
Ö»¶ÁÊý¾Ý·ÃÎʲ»ÒªÊ¹ÓÃDataSet
¹Ø±ÕASP.N ......
´úÂëÈçÏ£º
System.Web.HttpBrowserCapabilities browser = Request.Browser;
string s = "Browser Capabilities\n"
"Type = " + browser.Type ;
"Name = " + browser.Browser ;
"Version = " + browser.Version ;
"Major Version = " + browser.Ma ......
xtreeView.js
---==========================================================
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
if (ie5||ns6)
var menuobj=document.getElementById("Panel2")
function showmenuie5(e)
{
&n ......