Set up to Web.config:
in
The festival starts with:
<
Configsections
>
<
section
Name
= "RewriterConfig"
Type
= "Urlrewriter.config.rewriterconfigserializersECTIONHANDLER, URLREWRITER"
/>
CONFIGSECTIONS>
in
Plus:
<
RewriterConfig
>
<
Rules
>
<
Rewriterrule
>
<
Lookfor
>
~ / News, (D {4}), (D {1, 2}), (D {1, 2}), (D {1, 9}). ASPX
Lookfor>
Sendto>
ReWriterrule>
LOOKFOR>
In addition:
Treat a link: news.aspx
Private void page_load (object sender, system.eventargs e) {// Place user code here to initialize page DATATABLE DT = New DataProvider (). getnewstoIndexpage (1); // Format URL URLFORMAT FORMATS = New urlFormat (); lbnews.text = "
"; If (dt.rows.count> 0) {int counter = 0; while (counter
" Formats.newsurl (DateTime) Dt.Rows [counter" ["newspubtime"], convert.toint32 (DT.ROWS [counter] ["newsid"])) "" Target = "_ blank"> DT .Rows [counter "]. Tostring () "; counter ;}} else {lbnews.text = "No content";} lbnews.text = "; dt.clear (); DT .Dispose ();
URLFORMAT.CSPUBLIC CLASS URLFORMAT {Public UrlFormat () {} Public Virtual String NewsURL (DateTime DT, INT NEWSID) {Return getURL ("news, {0}, {1}, {2}," newsid ".aspx" , DT.Year, DT.MONTH, DT.DAY;} protected pattern, params object [] items {return string.format (pattern, items);}}
Formatted as: News, 2004, 8, 13, 123.aspx pointing: news.aspx? Parameters = Some parameter
Role: You can hide the true URL, cool!
Related DLL file download: http://bbs.mvpcn.net/postattachment.aspx? Postid = 405
Another one: http://www.codeproject.com/aspnet/urlrewriter.asp]>