Solved

Friendly Urls

Posted on 2013-01-13
5
160 Views
Last Modified: 2013-04-22
i would like to rewrite / route my urls
my url is like this: http://localhost:51519/Categories.aspx?ctid=1&cttitle=TUTORIALS&cid=37&ctitle=Hello
and i would like to rewrite to:
http://localhost:51519/Categories.aspx/1/TUTORIALS/37/Hello

how can i do this?
(i'm developing in 4.0)
thanks advanced.
0
Comment
Question by:Molnar István
5 Comments
 
LVL 8

Accepted Solution

by:
deepu chandran earned 250 total points
ID: 38773332
Hi,

You can use HTTP Modules to Create Friendly URLs in ASP.Net. Find the below Articles

http://www.codeproject.com/Articles/53221/Redirector-Module 
http://msdn.microsoft.com/en-us/magazine/dd347546.aspx.


-- Deepu
0
 
LVL 23

Assisted Solution

by:Roopesh Reddy
Roopesh Reddy earned 250 total points
ID: 38773397
Hi,

I assume you are using ASP.NET WebForms!

Here is the neat walkthrough of the same - http://msdn.microsoft.com/en-us/library/dd329551(v=vs.100).aspx

Hope it helps u...
0
 
LVL 13

Author Comment

by:Molnar István
ID: 38774376
i have tried the following in the global.asax
       
 public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapPageRoute(
           "Categories",               // Route name
           "Categories/{cttitle}/{ctitle}",  // Route URL
           "~/Categories.aspx"      // Web page to handle route
        );

        }
        protected void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes(RouteTable.Routes);
        }

Open in new window

but i doesn't work
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38774420
Hi,

Can you explain in detail, what exactly it's not working?

Did you go throw the article? Did you had a look how to define the links in the web pages?

Few more articles - http://weblogs.asp.net/jalpeshpvadgama/archive/2011/12/11/easy-url-rewriting-in-asp-net-4-0-web-forms.aspx

Hope it helps u...
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38774653
Is this a MVC project, or is this a Web Forms project? If the latter, then routes.config isn't going to do you any good.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question