Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7500661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:15:34+00:00 2026-05-29T20:15:34+00:00

I have implemented URL mapping in our ASP.NET 4 application, but I have a

  • 0

I have implemented URL mapping in our ASP.NET 4 application, but I have a problem with some of our content.

Some of our products has a hyphen “-” or a question mark “?” in them. It’s not an option to remove that. A productname could be “My Product – Good for you?“.

We use two custom made methods, MakeUrlSeoReady and MakeUrlNonSeoReady. We replace space like this: Replace(” “,”-“), as this is the most SEO-friendly solution. However, we also need to make this work with both question marks and hyphens.

The reason we use the MakeUrlSeoReady / NonReady methods is to be able to show the “real” name.

Currently the mapping is defined as follows:

routes.MapPageRoute("Produkt visning",
                    "artikler/{Categoryname}/{SubCategoryname}/{ProductName}",
                    "~/SingleProduct.aspx");

So what I do is I retrieve the product depending on the ProductName. I use two methods I’ve created:

    public static string MakeUrlNonSeoReady(string text)
    {
        return text.ToLower().
           Replace("oe", "ø").
           Replace("aa", "å").
           Replace("ae", "æ").
           Replace("-", " ");
    }

    public static string MakeUrlSeoReady(string text)
    {
        return text.ToLower().
            Replace("ø", "oe").
            Replace("å", "aa").
            Replace("æ", "ae").
            Replace(" ", "-");
    }

So in the SingleProduct.aspx page I use the following string to get from our database:

string categoryName = HelperFunctions.MakeUrlNonSeoReady(Page.RouteData.Values["ProductName"]);

But this will of course not work. So any help is really appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:15:36+00:00Added an answer on May 29, 2026 at 8:15 pm

    An arguably cleaner and simpler method is to use a unique product identifier that is numerical or alphanumerical and is natively HTML encoded, and then simply put the product name as an unused parameter for SEO or search purposes.

    MSDN RouteCollection.MapPageRoute Method (String, String, String, Boolean, RouteValueDictionary)

    routes.MapPageRoute("Produkt visning", 
                    "artikler/{Categoryname}/{SubCategoryname}/{ProductIdentifier}/{ProductName}", 
                    "~/SingleProduct.aspx", false, new RouteValueDictionary 
        { { "ProductName ", string.Empty } }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented Facebook Connect with ASP.Net 3.5. My problem is when i click
I have implemented a simple jqGrid in my ASP.NET MVC 3 application. It shows
I have implemented simple com.sun.net.httpserver.HttpServer application using one of examples in the internet. Server
I have implemented authentication systems for webapps several times over the years, but before
I have a problem with Spring 3.0.7 Request mapping and the Spring standard theme
Hai Thanks for everything. I have successfully implemented clean URL in local. Very nice
I am developing a web application using Asp.net mvc framework with concept of sub
I'd like to implement the asp.net 3.5 url routing functionality to take in links
I have the next problem: I am trying to deploy an application on my
I have implemented the following in to one of our sites to show an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.