Solved

Friendly Urls

Posted on 2013-01-13
5
156 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 74

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now