Last post Apr 11, 2008 03:59 PM by brucevde
Apr 07, 2008 01:55 PM|Davids_Maguire|LINK
I'm using ASP.net CMS Called Kentico ...
This CMS gives the end user the ability to dynamically update his website and create new pages.
the probelm is that ... These pages don't exist physically as files on the hard disk ?!! rather , the page content andit is HTML layout exist in DB ?
1 :- How can I do some thing like that ??
2:- is it possible to intercept the request - for example : www.somthing.com/100.aspx - then may be I can use the ID there -in this case
100- for getting information from DB then create a page in the runtime rendering it as a response for that request??
Apr 07, 2008 02:35 PM|crfenix|LINK
Why not having a page template (or many templates according how many page types you have). Then you recieve
www.somthing.com/100.aspx and making a url translation (UrlRewritingNet for instance) you know that this means
www.somthing.com/template.aspx?pageId=100. Then you go to the database and fill the page with the data of the page with id = 100. For this you need a pages table on the database of course.
Doing this you avoid creating pages physically what is not very common (and not recomended in most of the situations :-) ) for content management.
Here you have a starter kit that may help you with this
Apr 07, 2008 02:35 PM|RyanSJedi|LINK
Check out the MVC pattern http://weblogs.asp.net/scottgu MVC allows you to do this fairly easily...I should note however that MS's MVC is still in early development.
You can achieve something similar with URL Rewriting if you don't want to wait for MVC to be released and are squeemish about being an early adopter. Do a google for Asp.net and URL Rewriting and you should find some info to help.
Apr 07, 2008 02:44 PM|Davids_Maguire|LINK
thanks both for your replay .. but it is not about URL rewritting in any way ..
i'm just wondering .. how they did it in this CMS .. they r giving the user the ability to create pages on the runtime ... wheres these pages are not written physically to the hard disk .. the CMS system is still able to handle requests to such pages
by reading its content ffrom DB
Apr 07, 2008 03:01 PM|RyanSJedi|LINK
Well there's two issues here...one is the URL handling
www.somesite.com/100.aspx (where page doesn't physicall exist) and an actual DB record with all the layout and content stuffed into it.
There is either URL rewritting going on (which is simply the use of an ISAPI filter to preprocess the incoming request before handing it off to IIS, rolling their own version of URL rewritting wouldn't be out of the question) or they rolled their own version
of MVC...in MVC the page doesn't physically exist either....there is a 'command router' that listens for all the information that follows
www.somesite.com/ and then processes it. There's really no other way in that something HAS to stand in between IIS and the incoming request to achieve this kind of behavior.
There are some examples out there of how people are creating dynamic 'command routers' with MVC that would offer the functionality you are describing.
Apr 11, 2008 03:59 PM|brucevde|LINK
Kentico has implemented a .NET VirtualPathProvider which allows you to store most website files/resources anywhere you want.