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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:52:27+00:00 2026-05-28T15:52:27+00:00

I am going through a weird problem right now regarding routing in ASP.NET WebForms.

  • 0

I am going through a weird problem right now regarding routing in ASP.NET WebForms. The only reason I am trying to use routing is to achieve better looking URLs and nothing else. Also, this is the first time ever I am trying to implement routing.

My goal is simply:
http://www.domain.com/default.aspx –> http://www.mydomain.com/Home-Page

So, I have implemented the following in my global.asax

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    RegisterRoutes(RouteTable.Routes)
End Sub

and

Sub RegisterRoutes(ByVal routes As RouteCollection)
    routes.MapPageRoute("homepage", "Home-Page", "~/Default.aspx")
End Sub

The goal is achieved however, all the images on my pages disappeared for logical reasons;
instead of locating img/someimage.png it was trying to get Home-Page/img/someimage.png

Now, I can of course correct the path for my images but that is going to take quite a long time. I would gladly get rid of routing instead.

My question:
Is there any way to prevent folders (images, css, js etc.) from getting affected by the routing mechanism and only achieve nice URLs?

  • 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-28T15:52:27+00:00Added an answer on May 28, 2026 at 3:52 pm

    You can tell routing to ignore specific file types. Make sure this entry comes before the specific routes.

    routes.IgnoreRoute("{file}.png")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying out ASP.NET MVC 2 by going through the NerdDinner tutorial. But apparently
Going through a weird problem here. I am trying to get the date of
Lately, I've been going through a pretty weird phase. I feel the need to
I'm going through the problems on projecteuler.net to learn how to program in Erlang,
We're going through a massive migration project at the minute and trying to validate
Hey there! I'm doing this project and right now I'm trying to: create some
I have been going through this weird issue on some of my virtual machines.
So I have a very weird problem. I am writing some code in VB.Net
Going through some of my older Delphi projects and upgrading them to D2009, as
Going through Javascript documentation, I found the following two functions on a Javascript object

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.