ASP.NETʵÏÖURLÖØд
ʹÓÃURLÖØд¿ÉÒÔʵÏÖÓÃhttp://www.mzwu.com/d100.aspxÀàËƵĵØÖ·À´·ÃÎÊhttp://www.mzwu.com
/default.aspx?id=100£¬ÕâÑùµÄºÃ´¦·Ç³£¶à£ºÒ»ÊÇÒþ²ØÁËÕæʵ·¾¶£¬Ìá¸ßÓ¦ÓóÌÐòµÄ°²È«ÐÔ£»¶þÊÇÓÐÀûÓÚËÑË÷ÒýÇæÊÕ¼£»ÈýÊDZãÓÚ¼ÇÒ䡣ϱß
ÎÒÃÇÀ´¿´¿´ÔÚASP.NETÖÐÔõôʵÏÖURLÖØд¡£
1.ÏÂÔØURLRewriter.dll
·Åµ½BinÎļþ¼ÐÖС£
2.Web.configÖÐÅäÖãº
³ÌÐò´úÂë
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<!-- ¹æÔò1 -->
<RewriterRule>
<LookFor>~/d(\d+)\.aspx</LookFor>
<SendTo>~/default.aspx?id=$1</SendTo>
</RewriterRule>
<!-- ¹æÔò2 -->
<RewriterRule>
<LookFor>~/k(\d+)\.aspx</LookFor>
<SendTo>~/default.aspx?key=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
</system.web>
</configuration>
OK£¬
ÕâÑù¾ÍʵÏÖÁËURLÖØд£¬ÔËÐвâÊÔ¾ÍÄÜ¿´µ½½á¹ûÁË¡£²»¹ý£¬ÕâÑù»¹´æÔÚÒ»¸öÎÊÌ⣺µ±Ò³ÃæÖнøÐлص÷ʱ£¬URL»á±ä³ÉÕæʵµÄµØÖ·
http://www.mzwu
Ïà¹ØÎĵµ£º
×îÖÕЧ¹ûÈçÏÂͼ£º
-----------------------------------------------------------------------------------------------
Ñùʽ²¿·Ö£º
<style type="text/css">
.anpager .cpb
{
& ......
1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯¡¡
¡¡
Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕÊ±Ê ......
ǰ̨ aspx Îļþ:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="List" %>
<!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" >
<he ......
·½·¨Ò»:
public void page_load(Object obj,EventArgs e)
{
//´´½¨·þÎñÆ÷¶Ë¿Ø¼þ.
//Ö¸¶¨µÄ±ê¼Ç"LINK"³õʼ»¯´ËÀàµÄÐÂʵÀý.
HtmlGenericControl objLink=new HtmlGenericControl("LINK");
objLink.ID=ID;
objLink.Attributes["rel"]="stylesheet ......