.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

url rewriting / routing

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :ASP.Net


I have my categories in database, and want something url rewriting/routing to make my url nicer and more SEO friendly.

I have divided my categories into the following:

Cars > Select car > Car model > 

how do I create url rewriting / routing in my categories?? - 'm a little confused!

I use framework 4.0

thanks :-)

View Complete Post

More Related Resource Links

Confusion Regarding Routing, Rewriting and SEO


I have created a Web site to do with Booking Accommodation and am getting a little confused about a few things.

I have an SSL certificate which works with 'bookingac.com' so decided to have the whole site without www in front to simplify things. A problem is that all of my pages can be accessed with the www in front or not, and I am concerned that this may be bad for my search engine ranking. Therefore, I created a page called redirector.aspx which does "Response.RedirectPermanent("http://bookingac.com/home", True)" as the default page. This effectively removes the www for the home page but not the other pages. I have an http module which redirects from http to https and back for pages where security is required.

Am I going about removing the www the right way? Should I be removing the www using the http module? I had that half working but it appeared to break the ability to logout once logged in.

I have URL routing working so perhaps I should remove the www using that? I am not sure how to go about that.

In addition I had links like this
which now look like this
and Google is taking forever to pick up the new URL - I still accept both. I have updated all of t

Routing for Web Forms in ASP.NET 4.0

posted a prototype demonstrating how one could use Routing within Web Forms. This is something you can do today with ASP.NET 3.5 SP1, because of the work we did to separate Routing from ASP.NET MVC. I would have liked to include Web Form Routing as part of the Routing feature when we were working on SP1, but we didn't have the time to do so in a robust manner before SP1 was locked down.

What's new in ASP.NET 4.0 - Part II - Routing in Webforms

This post covers one such feature which is Routing in Webforms. Although Routing was available even in .NET 3.5 SP1, (check this excellent post by Phil Haack on implementing Routing in ASP.NET 3.5 with .NET 3.5 SP1), it was kind of less known. Also the plumbing work was too much for getting it implemented.

ASP.NET 4.0: WebForm Routing (quick n dirty version)

One of the things we're adding in ASP.NET 4.0 is built-in support for using Routing together with WebForms. Now, I'm totally aware that this is possible to do already and that a number of people have posted ways of doing this with the Web Routing feature which shipped with ASP.NET 3.5 SP1. We're just adding some features to make it easier to do

URL Rewriting

If you click on the link you can have look at how the URL rewriting is working. It can be easily understand with screen shot!!!


Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

URL rewriting with webserver in VS.NET2010



is it possible to have same URL rewriting behaviour in integrated webserver as in "real" IIS7?


Routing in dynamic data applications


Im using ASP.Net 4. I tried to modified the code according to following video tutorial. http://www.asp.net/aspnet-in-net-35-sp1/videos/how-to-enable-table-specific-routing-in-dynamic-data-applications

But Product page directs only to ListDetails.aspx page.

This is my code :

<%@ Application Language="C#" %>
<%@ Import Namespace="System.ComponentModel.DataAnnotations" %>
<%@ Import Namespace="System.Web.Routing" %>
<%@ Import Namespace="System.Web.DynamicData" %>

<script RunAt="server">
    private static MetaModel s_defaultModel = new MetaModel();
    public static MetaModel DefaultModel {
        get {
            return s_defaultModel;

    public static void RegisterRoutes(RouteCollection routes) {

        DefaultModel.RegisterContext(typeof(NorthwindDataContext), new ContextConfiguration() { ScaffoldAllTables = true });


postbacks and url rewriting


Hi all,

I am using Intelligencia url rewriter for my project and have run in a small problem. I have a regular expression like

<rewrite url="~/(.+)/(.+)/(.+).aspx" to="~/Article.aspx?a=$3&amp;s=$2&amp;p=$1"/>

so a page request like

/parent/category/articlename.aspx is interpreted as /Article.aspx?a=articlename&s=category&p=parent.

This above is all fine, but now when I do a postback (a login block), it picks up the url /Article.aspx?a=articlename&s=category&p=parent and interprets as /Article.aspx?a=article&s=category&p=parent.

Now, how can I make sure that on the postback, it still throws back the original url /parent/category/articlename.aspx so that the url is properly interpreted?


css and images gone on url rewriting


 I have a program which rewrites a url to a form     website.com/Default.aspx/name/articleid

The Program works fine ,but after URL rewriting my css sheet and images are gone . 

I am new to this and I have read that I should map my css and images to root. 

So ,I hav done some change to the path files of css and images but it stilll doesnt work .

Plz help me over this ...... 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TBV.aspx.cs" Inherits="TBV" %>

<!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="server">
    <title>Article Page</title>
    <link rel="index" href="~/" title="Home" />
    <link rel="Stylesheet" media="screen,projection" type="text/css" href="~/css/main.css" />
    <link rel="stylesheet" media="print" type="text/css" href="~/css/print.css" />
    <link rel="stylesheet"

URL Routing and Existing HttpHandler problems


Hello everyone,

I have a problem:

I am currently using 2 features: 

1. HttpHandler

Registering the path="res.aspx" verb="*"

2. URL Routing:

Registering with this pattern: "Company/Edit/{*companyId}","~/CompanyEdit.aspx"

In my CompanyEdit.aspx page, I used httphandler res.aspx to generate some images at client.

  • res.aspx?img=1
  • res.aspx?img=3

Now the problem is here, the page is load success with companyId = "12345", but when the images was loaded at client, it loaded the CompanyEdit.aspx again and show error with wrong id.  

I have debug and find the problem that because when image's urls were generated to client with url=res.aspx?img=1, url=res.aspx?img=3, the asp.net will understand that they are Company/Edit/res.aspx?img=1, Company/Edit/res.aspx?img=3 when it maps with URL Routing pattern.

=> So the CompanyEdit.aspx was load again with wrong id (id now is "res.aspx"). 

So, do you have any ideas to solve this problem, or other design.

Thanks, and best regard

Security Briefs: Protect Your Site With URL Rewriting


Learn the numerous ways in which you can rewrite URLs to defend against common Web vulnerabilities.

Bryan Sullivan

MSDN Magazine March 2009

Extreme ASP.NET: Routing with ASP.NET Web Forms


See how to get the benefits of rerouting while alleviating the risks with this in-depth look at URL rewriting in ASP.NET.

Scott Allen

MSDN Magazine January 2009

routing fails



I am trying to compile and run an asp.net application and am getting the following errors

 HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

I have a starting URL of http://localhost:61431/WebSuds/Suds/Welcome and routing code

"Default",                                 // Route name
"{controller}/{action}/{page}",            // URL with parameters
new { controller = "Suds", action = "Welcome",

Strange URL Routing Problem, participially working


I am setting up URL Routing on my existing project. I am not using mvc.

The routing only working like this: http://www.example.com/sdevil.m

not working with single word like this: http://www.example.com/sdevil

I am getting error message:The resource cannot be found.

Looks like when I using single word, application think that is folder?

How can i fix this? Thank you for any helps.

Video: SharePoint 2010: Advanced Routing and Document Sets

Learn how to work with document sets such as RPFs (Request for Proposal), which may be made up of multiple documents such as the question document, the answer document, and many other supporting documents and files. (Length: 13:56)

Problem with default routing

Hi, I am Ashish. I have developed an ASP.NET web application using MVC 1.0. I have taken a view named TaskUI and Controller TMController. I have chosen my UI page is as default page, and accordingly I changed Default Rout as given bellow: routes.MapRoute( "TaskUI",// Route name "{controller}/{action}/{id}"// URL with parameters new{ controller = "TM", action = "CreateTask", id = "" } // Parameter defaults); It is working great... My UI page contains a textbox which is tagged with a javascript onChange function <%=Html.TextBox("TaskId", ViewData.Model.Task.TaskId, new { size = 10, onChange = "GetTaskInfo1()", onkeypress = "InputOnlyNumber(event)" })%> When I input a value on the textbox and press the tab the javascript function is called which isfunction GetTaskInfo1() { var vCalleeVar1 = document.getElementById('TaskId').value; if (vCalleeVar1 != undefined && vCalleeVar1 != null) { location.reload("GetTaskInfo?pTaskId=" + vCalleeVar1); return true; } else return false; } Now the problem is the URL that gets LocalHost.../GetTaskInfo?pTaskId=123, whether it should be LocalHost.../TM/GetTaskInfo?pTaskId=123, because the action "GetTaskI
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend