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  |  

Affordable ASP.NET Hosting Service
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
Verndale
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Chat About It!  How does default.aspx work?
Previous Previous
 
Next Next
New Post 6/16/2008 1: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 2:06 PM
User is offline Slavic Kozyuk
126 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 2:16 PM
User is offline Brandon Haynes
705 posts
brandonhaynes.org
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 2: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 2:49 PM
User is offline Brandon Haynes
705 posts
brandonhaynes.org
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.

 


Windsor Management Group
Fund Accounting Software for K12 Education.
Infinitevisions.com
Convert Visitors to Customers
In order to bring value to your users, we must first understand them. VIVIDSITES will help you build a custom web application and interactive marketing tools that your users will thank you for. We marry high-end creative with head banging technology to entertain and convert visitors into paying customers. Call 314.514.0505 or visit us at http://www.vividsites.com to find out how.
- V I V I D S I T E S -
Gearworx Web Hosting
As a premier provider of Web Hosting, Private/White Label hosting, Server Colocation, Dedicated Server, and other Managed Services, Gearworx offers an array of services designed to more effectively manage strategies driving businesses on the Web. Headquartered in Fremont, California our state of the art tier one data centers and distributed managed services environment enables Gearworx to offer your business enterprise level solutions through simplified processes.
Gearworx Web Hosting

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