Recent Articles

 
1: Read And Write XML with Dataset
Category: VB.NET
Added: 2/11/2009

 
2: Split Ajax Tab Control into Rows
Category: AJAX
Added: 2/2/2009

 
3: Path Less Css in Master Page in Asp.Net
Category: ASP.Net
Added: 1/27/2009

 
4: Prevent user going back to restricted area
Category: ASP.Net
Added: 1/25/2009

 
5: Sql Server MSC Error
Category: Databases
Added: 1/10/2009

 
6: Web Browser Control Javascript Close Button Error
Category: VB.NET
Added: 1/3/2009

 
7: ChartFX Volume in Candlestick without Extensions
Category: VB.NET
Added: 1/3/2009

 
8: Hard disk serial number Library
Category: VB.NET
Added: 1/3/2009

 
9: Roles And Membership
Category: ASP.Net
Added: 6/2/2008

 
10: ListView and DataPager in ASP.NET 3.5
Category: ASP.Net
Added: 5/15/2008

UrlRewriter with asp.net

by Imran 19/January/2008

A rewrite engine is software that modifies a web URL's appearance (URL rewriting). Rewritten URLs (sometimes known as short or fancy URLs) are used to provide shorter and more relevant-looking links to web pages. The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the world.

This URL contains query string parameters that encode blog entry dates

http://www.example.com/Blogs/Posts.php?Year=2006&Month=12&Day=19

but can be altered to give the user a clear idea of what he or she is going to see

 http://www.example.com/Blogs/2006/12/19/ 

We are using Intelligencia.UrlRewriter.dll.

Web.Config
 

<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.

Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>

<httpModules>

<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>

</httpModules>

<rewriter>

            <rewrite url="~/Article/(.+).aspx" to="~/Article.aspx?category=$1"/>

</rewriter>

1. (~/Article.aspx?category=$1)

Your actual page in root directory and category is parameter.

2. (~/Article/(.+).aspx)

Artifical URL looks like http://www.yourwebsite.com/Artical/page.aspx

Article.aspx.vb

 Request.QueryString("Category")

You  can download free library from

http://urlrewriter.net/index.php/support/configuration/ 




Powered by DotNetClassic.com