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 6997465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:17:13+00:00 2026-05-27T20:17:13+00:00

I will try to explain this the best I can. I created a CMS

  • 0

I will try to explain this the best I can.

I created a CMS that allows you to create Categories and Content Sections. Both have completely different templates, but I want to use the same URL routing mapPageRoute param when routing. Basically, I need it to check if the alias is a category, if not hit the content section router.

Here is my Registered Routes on Global.asax:

void RegisterRoutes(RouteCollection routes)
{
    routes.MapPageRoute(
        "Home",
        string.Empty,
        "~/Default.aspx"
    );

    routes.MapPageRoute(
        "Category",
        "{*CategoryAlias}",
        "~/templates/Category.aspx"
    );

    routes.MapPageRoute(
        "Content",
        "{*ContentAlias}",
        "~/templates/Content.aspx"
    );
}

Currently, Categories work fine, but when I put a content section alias in the URL it hits categories and doesn’t skip to the next route to try. The Category.aspx and Content.aspx web forms have completely different views. The code behind is similar but one accesses the Category tables/procedures and the other Content.

If anyone requires more information just ask.

  • 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-27T20:17:13+00:00Added an answer on May 27, 2026 at 8:17 pm

    Have you tried something like this?

    void RegisterRoutes(RouteCollection routes) 
    { 
        routes.MapPageRoute( 
            "Home", 
            string.Empty, 
            "~/Default.aspx" 
        ); 
    
        routes.MapPageRoute( 
            "Category", 
            "Category/{Cat}/{*queryvalues}", 
            "~/templates/Category.aspx" 
        ); 
    
        routes.MapPageRoute( 
            "Content", 
            "Content/{Cont}{*queryvalues}", 
            "~/templates/Content.aspx" 
        ); 
    } 
    

    And then make sure the URLs have either Category or Content in the path. You still get the catch-all with *queryvalues

    EDIT:

    If you have the following uri http://www.example.com/Content/Press you can access Press by using the following:

    Page.RouteData.Values["Cont"].ToString();
    

    So, in your Content.aspx page, grab that string and then use that to determine which site the user was trying to get to.

    You need to include some kind of static URL differentiator so that the MapRouter can find where to map the page.

    If you don’t include the static Category or Content in the beginning of the uri, the MapRouter will always be satisfied with the first map (the Category mapping) and never know to skip it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will try to explain this the best way I can, but feel free
I will try my best to explain this. I have an application that show
I will try and explain this the best way I can. I have a
I will to try to explain this as best as I can. I have
I'll try to explain this as best as I can. I have a form
Alright, Ill try to explain this as best as I can first... My program
Good day, i will try to explain my problem as best as i can.
I'll try to explain this as best as i can, but i appologize if
I will try to explain as best as I can what I realy want
I'll try to explain this as best I can. I have an ArrayList of

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.