ASP.NET ÈçºÎʵÏÖα¾²Ì¬
ÆäʵËùνµÄα¾²Ì¬Ò³Ãæ,¾ÍÊÇÖ¸µÄURLÖØд.
1.Ê×ÏÈÔÚweb.configÀïд
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
2.ÔÚweb.configÀïÌí¼ÓÒÔϽڵã
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
3.ÅäÖÃÖØдURL¹æÔò (ÕâÀïÎÒÃǾÍÒÔ *.htmlתµ½*.aspxΪÀý×Ó£¬µ±È»Ò²¿ÉÒÔʵÏÖ http://www.a.com/a-1.html תµ½ http://www.a.com/a.aspx?id=1 ÕâÖÖÐÎʽ),
ÔÚconfiguration ¼ÓÈëһϽڵã
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/(.*).html</LookFor>
<SendTo>~/$1.aspx</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
4.ÕâÒ»²½ Ò²ÊÇ×îÖØÒªµÄÒ»²½¡£ÔÚiis ÖÐÓÒ¼üÏîÄ¿→ÊôÐÔ→Ö÷Ŀ¼→ÅäÖÃ→Ó³Éä→Ìí¼Ó
¿ÉÖ´ÐÐÎļþÀïÃæÊäÈë c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll£¬
À©Õ¹ÃûÊäÈë .html
È»ºóÔÙ°Ñ È·ÈÏÎļþÊÇ·ñ´æÔÚ Ç°ÃæµÄ¹³¹³È¥µô¡£(Õâ²½ºÜÖØÒª£¬²»È»»á±¬404µÄ´íÎó)
ÈçÏÂͼËùʾ:
5.ÄúÐèÒªÔÚÄãµÄÏîÄ¿ÖÐÒýÓà URLRewriter.dll Õâ¸ödllÎļþ ¡£
ÏÂÔصØÖ·£º http://download.csdn.net/source/2325865
6.ÕâÑù ¾ÍÅäÖÃÍêÁË£¬¼ÙÉè ÄãÓÐ http://192.168.0.2/index.aspx Õâ¸öÒ³ÃæµÄ»°¡£
ÄÇôÄãÔÚä¯ÀÀÆ÷ÖÐÊäÈë http://192.168.0.2/index.html ¾Í¿´µ½Ð§¹ûÁË.
×¢£ºÒÔÉÏ ÊÇÔÚ server2003 iis 6.0 framework2.0 ÏÂÅäÖõġ£
¸½ÉÏ ÍêÕûµÄWeb.Config´úÂë°É
<?xml version="1.0"?>
<configuration>
<!--1-->
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true"/>
<authenti
Ïà¹ØÎĵµ£º
asp.net¼òÌå×Öת·±Ìå×ÖµÄÀà¿â
ÕⶫÎ÷ËäÈ»¼òµ¥£¬µ«Ò²²»Ê§Îª¾µäµÄÀà¿â£¬¸öÈ˶øÑÔ£¬¾Í·Ç³£Ï²»¶Õâ¸öÀà¿â¡£
ÓÃÎÄ×ּǼÏÂÀ´°É£¬Áô¸ö¼ÇÄî°É
ÔÚvsÖУ¬ÓÐÒ»¸ö¾µäµÄMicrosoft.VisualBasic.dllµÄVBÀà¿â£¬¸ù¾Ý¹Ù·½µÄÃèÊö£º
ËüÄÜÌṩ¶ÔÐí¶à .NET Framework ÀàµÄ¼òµ¥Ö±¹ÛµÄ· ......
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="s ......
ASP.NET Ê×Ò³ÐÔÄܵÄÊ®´ó×ö·¨
Ç°ÑÔ
±¾ÎÄÊÇÎÒ¶ÔASP.NETÒ³ÃæÔØÈëËÙ¶ÈÌá¸ßµÄһЩ×ö·¨£¬ÕâЩ×ö·¨·ÖΪÒÔϲ¿·Ö£º
1.²ÉÓà HTTP Module ¿ØÖÆÒ³ÃæµÄÉúÃüÖÜÆÚ¡£
2.×Ô¶¨ÒåResponse.FilterµÃµ½Êä³öÁ÷streamÉú³É¶¯Ì¬Ò³ÃæµÄ¾²Ì¬ÄÚÈÝ(´ÅÅÌ»º´æ)¡£
3.Ò³ÃæGZIPѹËõ¡£
4.OutputCache ±à³Ì·½Ê½Êä³öÒ³Ã滺´æ¡£
5.ɾ³ýÒ³Ãæ¿Õ°××Ö·û´® ......
Global.asaxÎļþ£¬ÓÐʱºò½Ð×öÓ¦ÓóÌÐòÎļþ£¬ÌṩÁËÒ»ÖÖÔÚÒ»¸öÖÐÐÄλÖÃÏìÓ¦Ó¦ÓóÌÐò¼¶»òÄ£¿é¼¶Ê¼þµÄ·½·¨¡£Äã¿ÉÒÔʹÓÃÕâ¸öÎļþʵÏÖÓ¦ÓóÌÐò°²È«ÐÔÒÔ¼°ÆäËüһЩÈÎÎñ¡£ÏÂÃæÈÃÎÒÃÇÏêϸ¿´Ò»ÏÂÈçºÎÔÚÓ¦Óù¤×÷ÖÐʹÓÃÕâ¸öÎļþ¡£
¸ÅÊö
Global.asaxλÓÚÓ¦ÓóÌÐò¸ùĿ¼Ï¡£ËäÈ»VisualStudio.NET»á×Ô¶¯²åÈëÕâ¸öÎ ......
×î½üҪдһ¸öÔÚÍøÒ³ÖвéÕҹؼü×Ö¼°Á´½ÓµÄ³ÌÐò£¬ÔÚÊä³öµ½TextBoxµÄʱºò·¢ÏÖ¾³£³öÏÖÂÒÂ룬ÕûÀíÁËһϸù¾Ý²»Í¬µÄ±àÂëÑ¡È¡ÍøÒ³Ô´Îļþ£¬Ä¿Ç°¿ÉÒÔ½â¾ö¼¸ÖÖ³£±àÂ뷽ʽµÄÍøÒ³£¬¸ÐÐËȤµÄ¿ÉÒÔÊÔÏ¡£
±¾À´ÏëÓÓ£½£½”ÅжϱàÂ룬¸Ð¾õ±È½ÏÂé·³£¬ËùÒÔ¸ÄÓñȽÏÄ£ºýµÄ·½·¨£¬ContainsÓÃÔÚÕâÀïͦ·½±ãµÄ¡£
Contains˵Ã÷£º¾ÍÊÇ·µ» ......