IIS and Default.aspx

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
2/9/2009 1:40:11 PM
Gravatar
Total Posts 25

IIS and Default.aspx

 I have an issue were I don't really know or want to deal with how to have IIS understand that a url such as

www.mysite.com/somefolder should actually be www.mysite.com/somefolder/default.aspx

I was wondering if I could catch the URL request and if the request has no page specified, just concatenate the Default.aspx postfix onto the URl and let normal processing continue?

 

Am I just totally out in left field here or is the a possibility?

 

 

Thanks, Joe2

2/9/2009 2:05:18 PM
Gravatar
Total Posts 18439

Re: IIS and Default.aspx

With the latest release if you create a folder somefolder and put a empty text file there named Default.aspx it will work using the url www.mysite.com/somefolder

Other than that its not possible unless you get an add on for IIS. The problem is by default .NET only handles requests for certain extensions like .aspx, images and other files like .js are handled directly by IIS without invoking .NET code at all.

So the problem with www.mysite.com/somefolder is that IIS will get that request and never hand it off to .NET so there is no way (without add ons for IIS) you can do anything like concating the default.aspx because your code won't run unless IIS gives the request to .NET for handling and it won't do that unless the request is for an extension that .NET handles. So by having a real folder and a real file Default.aspx then since Default.aspx is a default document IIS will hand the request to .NET code for handling.

Hope it helps,

Joe

2/9/2009 2:20:08 PM
Gravatar
Total Posts 25

Re: IIS and Default.aspx

 Ahh I see, Understood. The blank somefolder/Default.aspx trick works for me. Thanks.

PS: I'm going right now to buy you a couple beers. Thanks for your time.

Joe2

2/9/2009 2:28:49 PM
Gravatar
Total Posts 18439

Re: IIS and Default.aspx

Many Thanks for the beers!

Just noticed a bug in the confirmation email it seems to list the beers 2x, must be something I changed recently.

Just to be clear, this technique with the folders is for folder based sub sites not for ordinary pages. Hope that is what you were asking about. For ordinary pages in a site I don't recommend putting segments like /somefolder/ into the url.

Best,

Joe

2/9/2009 2:38:40 PM
Gravatar
Total Posts 25

Re: IIS and Default.aspx

 Yes, its for folder based sites.

Thanks, Joe2

You must sign in to post in the forums. This thread is closed to new posts.