Personal WebSite StarterKit in F#

Links: Up

This sample shows how to use F# for developing ASP.NET 2.0 data-driven web application. The sample uses ASP.NET Membership and Roles for managing users of the website and custom database for storing albums and photos.

NOTE: you will need to follow the instructions in Welcome.html, e.g. install SQL Server Management Studio Express and run the personal-add.sql SQL script in that tool.

The data-access core of the application and declaration of the data structures can be found in PhotoManager.fs. Note that we use F# record type to represent the data loaded from a database. For example:

  type Album = { AlbumID:int; Count:int; Caption:string; IsPublic:bool }
  type Photo = { PhotoID:int; PhotoAlbumID:int; PhotoCaption:string; }
  

The rest of the application logic is implemented in the pages, *.aspx file represents a ASP.NET markup with control declarations and *.aspx.fs implements a page logic in F#. The site also contains Admin directory which contains pages for uploading photos and creating albums, which can be accessed only by the administrator.

For more information about configuring the sample, see the sample Welcome page.