Me: I live in Silicon Valley with my wife, child and cat. I have worked at Microsoft since I graduated from College, both in the Macintosh Business Unit on products such as Outlook Express, Entourage, IE, and Virtual PC and in Windows Live on Hotmail, Calendar and People. I am currently a Principal Lead Program Manager on the Windows Live Social Networking team. I basically manage a team of Program Managers responsible for delivering features to support our web and client applications. I've been blogging since 2001 and like to play around with .NET in my spare time working on projects such as dasBlog (the blog that powers this site) and Send to SmugMug (an application for uploading photos to SmugMug). I blog about a number of technology and productivity related topics.
Powered by: newtelligence dasBlog 2.3.9074.18820
Disclaimer The posts on this weblog are provided "AS IS" with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Omar Shahine
E-mail
Just today I discovered how to use the FormatPage functionality in dasBlog. This functionality allows you to take a regular plain html file and have it rendered in your site using existing templates etc.
Coupled with URL Rewriting you can create your own custom URLs for these pages. Say for instance that I wish to create a page for some software projects I'm working on, I don't want create a blog post for this because I want it to be permanant and static etc. So I create a simple HTML file and name it:
somefile.format.html
This file should just contain the HTML that would normaly between the tag. Note that the file name must end in .format.html or none of this will work.
You then place this file anywhere in your blog. I like to keep things in my /content folder so I create a new folder called /projects in /content and place the file in there. The path on the server is now:
/content/projects/somefile.format.html
To get to this page in dasBlog I simply type:
http://www.shahine.com/omar/FormatPage.aspx?path=content/projects/somefile.format.html
However, I don't like the way this URL looks. So to address this I go into my Web.Config file and find the section and create a new URL mapper expression.
The following expression:
<add matchExpression="(?<basedir>.*?)/Projects\.aspx\?=(?<value>.+)" mapTo="{basedir}/FormatPage.aspx?path=content/projects/{value}.format.html" />
intercepts all requests to:
http://www.shahine.com/omar/Projects.aspx?=somefile
to
and shows the top URL to the user. Basically Projecs.aspx is a non existant page, and dasBlog is magically loading the content in somefile.format.html and displaying it to the user.
Now I can create a number of pages in my new /content/projects folder and I can use the same URL for all of them. I would simply change somefile to whatever the name of the *.format.html file prefix is.