Solved

Friendly Urls

Posted on 2013-01-13
5
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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