ASP.netµÄURLÖØÐ´
ÂäÈÕ¿Õ¼ä
ASP.net
µÄ
URL
ÖØÐ´
ÓйØÓÚ
URL
µÄÖØÐ´£¬±¾ÎÄÒ²Ö»ÊÇÄÃÀ´Ö÷Òâ¡£Ïà¼ÌÓÐ
MS
µÄ×é¼þ“
URLRewriter”ºÍÔÚGlobal.asaxÀïµÄ“
Application_BeginRequest()”±àÂ뷽ʽ£¬ÒÔ¼°IISÀïµÄISAPIÉèÖá£
ÄÈÁÐÏÂÀ´£¬ÊµÏÖ·½·¨Ò²¶¼ºÜ¼òµ¥¡£
·½·¨Ò»£ºMS×é¼þ
ÕâÀïÒ²²»ÓÃÏê½âÁË£¬Ïà¹ØÇë¿´£º
http://www.microsoft.com/china/msdn/library/webservices/asp.net/URLRewriting.mspx
Ó÷¨ºÜ¼òµ¥£¬Ö»ÐèÒª°Ñ×é¼þ
URLRewriter.dll
¿½µ½Ó¦ÓóÌÐòµÄ
bin
Ŀ¼Ï£¬È»ºóÔÚ
web.config
ϼÓÈëÈçÏ´úÂ룺
ÔÚ
<
configuration
></
configuration
>
ÖмÓÈ룺
<
configSections
>
<
section
name
="RewriterConfig"
type
="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"
/>
</
configSections
>
<
RewriterConfig
>
<
Rules
>
<
RewriterRule
>
<
LookFor
>
~/(\d{4})/(\d{2})/Default\.aspx</
LookFor
>
<
SendTo
>
~/Default.aspx?ID=$1</
SendTo
>
</
RewriterRule
>
</
Rules
>
</
RewriterConfig
>
È»ºóÔÚ
<
system.web
></
system.web
>
ÖмÓÈ룺
<
httpHandlers
>
<
add
verb
="*"
path
="*.aspx"
type
="URLRewriter.RewriterFact
Ïà¹ØÎĵµ£º
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£¬½«»á´ó´óÔöÇ¿Æä¹¦ÄÜ¡£ÒÔÍù£¬ÎÒÃÇÒ»°ãÊÇÔÚÉè¼Æ³ÌÐòʱ£¬¾ÍÒѾÉèÖúÿؼþÖеÄÄ£°æÊÇÔõÑùµÄÁË¡£µ«ÊÇ£¬ÓеÄʱºò£¬¿ÉÄÜÎÒÃÇÐèÒª¶¯Ì¬¼ÓÔØÄ£°æ£¬±ÈÈ磬µ±ÄãÒªÇóÄãµÄÓ¦ÓóÌÐòµÄ½çÃæ·ç¸ñËæ×ÅÓû§µÄÐèÇó¶ø±ä»¯Ê±£¬Äã¾ÍÐèÒ ......
ÔÚweb¿ª·¢Ê±£¬ÓеÄϵͳҪÇóͬһ¸öÓû§ÔÚͬһʱ¼äÖ»ÄܵǼһ´Î£¬Ò²¾ÍÊÇÈç¹ûÒ»¸öÓû§ÒѾµÇ¼ÁË£¬ÔÚÍ˳ö֮ǰÈç¹ûÔٴεǼµÄ»°ÐèÒª±¨´í¡£
³£¼ûµÄ´¦Àí·½·¨ÊÇ£¬ÔÚÓû§µÇ¼ʱ£¬ÅжϴËÓû§ÊÇ·ñÒѾÔÚApplicationÖдæÔÚ£¬Èç¹û´æÔھͱ¨´í£¬²»´æÔڵϰ¾Í¼Óµ½ApplicationÖÐ(ApplicationÊÇËùÓÐSession¹²Óеģ¬Õû¸öwebÓ¦ÓóÌÐòΨһµÄÒ ......
1ʲôÊÇͼƬµÁÁ´
ÈÃÎÒÃÇÏÈ·ÖÎöÒ»°ãµÄä¯ÀÀÏÖÏ󣬯äÖÐ×îÖØÒªµÄÒ»µã¾ÍÊÇÒ»¸öÍêÕûµÄÒ³Ãæ²¢²»ÊÇÒ»´ÎÈ«²¿´«Ë͵½¿Í»§¶ËµÄ£®Èç¹ûÄãÇëÇóµÄÊÇÒ»¸ö´øÓÐÐí¶àͼƬºÍÆäËüÐÅÏ¢µÄÒ³Ãæ£¬ÄÇô×îÏȵÄÒ»¸öHttpÇëÇó±»´«ËÍ»ØÀ´µÄÊÇÕâ¸öÒ³ÃæµÄÎı¾£¬È»ºóͨ¹ý¿Í»§¶ËµÄä¯ÀÀÆ÷¶ÔÕâ¶ÎÎı¾µÄ½âÊÍÖ´ÐУ¬·¢ÏÖÆäÖл¹ÓÐͼƬ£¬ÄÇô¿Í»§¶ËµÄä¯À ......