Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Friendly Urls

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
Molnar István
Asked:
Molnar István
2 Solutions
 
deepu chandranCommented:
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
 
Roopesh ReddyCommented:
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
 
Molnar IstvánHelpDesk / ProgrammerAuthor Commented:
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
 
Roopesh ReddyCommented:
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
 
käµfm³d 👽Commented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now