Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Chat About It!  How does default.aspx work?
Previous Previous
 
Next Next
New Post 6/16/2008 12:21 PM
User is offline jerome dayton
4 posts
10th Ranked


How does default.aspx work? 

While I understand that setting the IIS website properties to have default documents allows the following to work:

http://localhost/DotNetNuke/

http://localhost/DotNetNuke/default.aspx

I don't understand how it allows the following to work:

http://localhost/dotnetnuke/Host/Host%20Settings/tabid/16/portalid/0/Default.aspx

http://localhost/dotnetnuke/Admin/SiteSettings/tabid/39/Default.aspx

etc.

My reading of the IIS documentatation implies that default.aspx would also have to reside in all the subdirectores such as

/dotnetnuke/Host/Host Settings/tabid/16/portalid/0/

/dotnetnuke/Admin/SiteSettings/tabid/39/

which needles to say don't exist.  When I've tried create a simple website that hosts only default.html and has a couple of sub directories, it in fact requires that default.html exist in every directory for it to work.

In Java application servers, there is an ability to tell the server to match up to a certain portion of the url, e.g. "/dotnetnuke" in this case, and then hand the request to the association application.  But for the life of me I can't find similar capabilities in iis.

So what am I missing?

Jerome Dayton

 

 

 
New Post 6/16/2008 1:06 PM
User is offline Slavic Kozyuk
119 posts
www.ihostasp.net
9th Ranked






Re: How does default.aspx work? 

By default DNN uses “friendly URLs”, this essentially overwrites the urls to make them more SEO and human friendly. The URLs DNN generates do not physically exist, they are intercepted at the ASP.NET application level and are decoded to serve correct pages to the end user. The Default.aspx page is essentially a container with in which the actual DNN framework is invoked. Typically the medial, css, and javascript content should be stored in the /portals/[PortalID] folder (replace [PortalID] with the actual numeric portal number generated by DNN). In the Path references with in Text/HTML module use relative path such as /portals/[PoratlID]/myscript.js to load your custom script files and other media.


Affordable DotNetNuke Hosting Affordable DNN Hosting & Support - www.ihostasp.net
Slavic Kozyuk
IHOST, LLC
Call toll-free: 1.800.593.0238
 
New Post 6/16/2008 1:16 PM
Online now... Brandon Haynes
641 posts
everysport.net
7th Ranked


Re: How does default.aspx work? 

Hi Jerome,

Just to elaborate a bit on Slavic's response, DotNetNuke accomplishes this magic through the use of HttpModules.  If you look in your web.config, you'll see, under configuration/system.web/httpModules the following entry:

<add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" />

You'll definitely want to read up on httpModules, but essentially each registered module has the opportunity to handle EVERY request that his the ASP.NET process (which includes nonexistant .aspx pages, but not by default .html or .gif pages).

So even for a nonexistent url such as http://localhost/dotnetnuke/tabid/39/Default.aspx, this httpmodule will get a chance to process the request.

That's the first piece of the puzzle.  The second piece is how the httpModule converts the request to a usable one.  This is essentially executed by converting the intermediate url tokens to querystring parameters.

So the above url is converted by the httpModule code to: http://localhost/dotnetnuke/Default.aspx?TabId=39.  Once the httpModule has performed this conversion, the URL is passed off for "normal" handling.

The converted url does exist at /localhost/dotnetnuke/Default.aspx, and is henceforth handled normally.  DNN picks up the desired TabId via querystring.

Naturally I've simplified things a bit, but this is the essence of what goes on behind the scenes.

Hope this helps!

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post 6/16/2008 1:40 PM
User is offline jerome dayton
4 posts
10th Ranked


Re: How does default.aspx work? 

So the magic is in the HttpModules!!!   Thanks guys, I new it had to be somewhere!

Jerome Dayton

 
New Post 6/16/2008 1:49 PM
Online now... Brandon Haynes
641 posts
everysport.net
7th Ranked


Re: How does default.aspx work? 

No problem Jerome, glad we could help.  For more details, download the DNN source package and look at /Library/HttpModules/UrlRewrite/UrlRewriteModule.vb.  Most of the action occurs in the OnBeginRequest method.

Brandon


Brandon Haynes
BrandonHaynes.org
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Chat About It!  How does default.aspx work?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Where Every Home is an Investment
Where Every Home is an Investment
www.nestbrokers.com
Faculty of Graduate and Postdoctoral Studies
At the graduate level, the University of Ottawa offers more than 180 graduate certificates, master's degrees and PhDs, as well as interdisciplinary programs such as Women's Studies and Canadian Studies. Many postdoctoral opportunities are available in both the sciences and the humanities. For further information, please consult the site of the Faculty of Graduate and Postdoctoral Studies.
www.grad.uottawa.ca
Vekkin Solutions
Vekkin Solutions provides complete website solutions and custom module development to churches and small businesses.
www.vekkin.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP