Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 15th, 2012, 04:54 PM
Authorized User
 
Join Date: Dec 2011
Posts: 39
Thanks: 9
Thanked 0 Times in 0 Posts
Default I accidently figured out a way to get rid of the .aspx in the URL. Is it a hack?

I was messing round with testing my pages and I noticed that if you have a Default.aspx page in a folder, you can redirect to the folders root and the page will load without the "Default.aspx" in the URL.

I like it and for this new project I am working on I have organized my file structure so that every page has it's own directory and inside is a Default.aspx page.

This sounds like overkill but it's actually not bad at all. Everything is still well organized and my URL's are nice and clean.


*The question is, is it this a hack and will it cause problems later on? I make sure to use only asp:hyperlinks by the way.


Thanks.
 
Old May 17th, 2012, 11:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

This certainly works and won't break anything. It's the same concept that enables you to browse to something like www.domainname.com without specifying a page name. This is handled with a concept called Default Documents where IIS serves the first configured Default Document it finds in a folder when you don't explicitly specify one.

However, ASP.NET has a better mechanism to make this work: Routing.

http://weblogs.asp.net/scottgu/archi...-0-series.aspx
https://www.google.com/?q=asp.net+webforms+routing

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
IceThatJaw (May 17th, 2012)





Similar Threads
Thread Thread Starter Forum Replies Last Post
I figured it out shade cat BOOK: Ivor Horton's Beginning Visual C++ 2005 0 May 26th, 2007 05:24 PM
ASP/ASPX W3C validation URL OldCoder HTML Code Clinic 4 April 8th, 2006 11:58 PM
problem in getting rid of '+' sign in url encoding vopatel Javascript How-To 0 May 21st, 2005 11:36 AM
Display an image (I figured it out) gorney .NET Web Services 0 December 29th, 2003 03:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.