Welcome to AspAdvice Sign in | Join | Help

Orcs Goblins and .NET

I enjoy reading and writing. I hope you enjoy at least the former.

Simple CMS New Release Version 0.9.60908.1

A newer version of Simple CMS has just been released. The only significant change to Simple CMS is that it now supports sessions. This means that if you have a masterpage you are using with Simple CMS, you may now use the Session object in that masterpage file.

How to enable Session State with HttpHandlers
This was an interesting problem, because there isn't a page object in the normal sense of file with aspx as its extension. Normally one can just add enableSessionState = true at the top of the file. In order to achieve this with HttpHandlers you will need to implement System.Web.SessionState.IRequiredSessionState or System.Web.SessionState.IReadOnlySessionState. To do this you simply add one of these as if you are inheriting from a class.

In my case I use an HttpHandlerFactory, so I specified this for the created handler, and not the factory.

Sponsor

Published Friday, September 08, 2006 3:47 PM by Brendan

Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# CMS Planet » Simple CMS New Release Version 0.9.60908.1 @ Friday, September 08, 2006 6:57 PM

PingBack from http://weblog-pla.net/cms/2006/09/08/simple-cms-new-release-version-09609081/

CMS Planet » Simple CMS New Release Version 0.9.60908.1

# re: Simple CMS New Release Version 0.9.60908.1 @ Tuesday, September 12, 2006 8:31 AM

Brendan, very well done! Could you please clarify better what is it that you just provided and was not available in the previous version? I did not try out the previous version.

Steve

# re: Simple CMS New Release Version 0.9.60908.1 @ Tuesday, September 12, 2006 9:05 AM

Thanks, Steve.

This version was released for two reasons. In it a user is now able to use the session object. So if for example you wanted to save a value or access a value from session in your masterpage, you are now able to.

Brendan

# re: Simple CMS New Release Version 0.9.60908.1 @ Friday, September 15, 2006 8:27 PM

Hello Brendan, I'm kind of confused about when to use HttpHandlers and when to use HttpModules. You are using HttpHandlers (CmsPageFactory class) in your Simple CMS ... couldn't you achieve the same result by using an HttpModule???

Bob

# re: Simple CMS New Release Version 0.9.60908.1 @ Saturday, September 16, 2006 9:45 AM

Hi Bob,

Yes I can achieve a similar result using HttpModules. The problem is that most of the time I do not want Simple CMS to be called. Simple CMS is designed so that it can be added into an existing webpage. This means there is a lot of content for which I do not want Simple CMS to run. I am fairly certain that HttpModules are called every single time the web site is hit. If I am not mistaken the module is called even for content like images. (Someone please correct me if I am wrong, but I believe I am correct) So you see Bob there are times when a module is useful, but I don't want to have Simple CMS's code running even when hitting normal non-managed pages.

Brendan

# re: Simple CMS New Release Version 0.9.60908.1 @ Saturday, September 16, 2006 5:37 PM

Brendan, you are mistaken :-)

HttpModules are invoked only when requesting extensions registered by the .NET Framework. To handle images too you'd have to configure the proper image extensions as resources whose request has to be handled by the ASP.NET ISAPI filter.

Bob

# re: Simple CMS New Release Version 0.9.60908.1 @ Sunday, September 17, 2006 4:22 PM

Ha! You win, Bob. I can't remember what articles I readabout modules and handlers, but I bet you can google for some info on the differences between the two.

Brendan

Leave a Comment

(required) 
required 
(required) 
Enter the code you see below