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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:55:43+00:00 2026-06-09T12:55:43+00:00

I am going to implement routing feature in my asp.net4.0 application and following the

  • 0

I am going to implement routing feature in my asp.net4.0 application and following the given link:

URL-Routing

This is fine if an application has limited no. of pages but my application has lots of pages.
so i have to write code [ routes.MapPageRoute(“”,””,””); ] many times.
Can we map all pages by looping through any collection classes or by any other method.

Thanks

  • 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-06-09T12:55:45+00:00Added an answer on June 9, 2026 at 12:55 pm

    If you have a standard pattern for your url and your file structure you can use the placeholders in the mapped url too

    eg. If you can map every “{controller}/{action}/{id}” to “/Pages/{controler}/{action}.aspx”

    For example, i build a site that has this folder structure

    Project Folder Structure

    Under the root folder there is the Views folder where all my pages reside.
    Under the Views folder there is one subfolder for every “controller” (there is no controllers in webforms, but I follow the MVC conventions here)
    Under the controllers subfolders there are the aspx pages that represent different actions

    The aspx page names are the same for each controller (“Index.aspx”,”Add.aspx”,”Edit.aspx” etc)

    So I can have a general mapping rule

    routes.MapPageRoute("GeneralAction", "{controler}/{action}/{id}", "~/Views/{controler}/{action}.aspx");
    

    I don’t need different rules for different pages as long as the folder structure follows this pattern

    Now

    "/Patient/Add" will map to "~/Views/Patient/Add.aspx"
    "/Incident/Add" will map to "~/Views/Incident/Add.aspx"
    "/Patient/Edit/31" will map to "~/Views/Patient/Edit.aspx" (with id=31)
    

    etc, all matching this one rule above.

    of course if you want to override this rule you can define more specific routes BEFORE defining this one.

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

Sidebar

Related Questions

I am going to implement camera feature for my android app.for this, I searched
I am trying to implement Url routing in asp.net 4.0. I just a created
I am going to implement Download Queue for my application. One of its feature
I'm going to implement this The layout is exactly like it is tables so
I am going through a weird problem right now regarding routing in ASP.NET WebForms.
I'm going to implement JSON-RPC web service. I need specifications for this. So far
I'm going to implement a (simple) downloader application in Java as a personal exercise.
I am going to implement plugin pattern in my Android application. Right now I
I am going to implement StoreKit in an iPhone application and wanted to know
When i am going to implement Authorize.net payment gateway. However, I got this error:

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.