Solved

Friendly Urls

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help on C# Linq query on object 6 53
Error in page 3 45
Error in script 11 45
Entity Framework 7 31
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

21 Experts available now in Live!

Get 1:1 Help Now