Thursday, October 22, 2009

My first free ASP.Net CSS web template

Note: I've added a label: "Free Template" for all my posts relating to converting free CSS XHML web templates to Asp.Net web projects.

While watching TV for a couple evenings, I converted a simple CSS XHTML web template into a Asp.Net 2.0 project.

The template I converted I found on I like because most of the web templates are covered by the Creative Commons license. The license gives you two explicit rights: you are free to share the template and you are free to adapt the template. The license(s) have either one condition: you must attribute the template, in the manner as specified by the author or two: attibute and Share Alike, where if you share your creation, you must also use this license (Or a similar one).

The template I altered was this one: sparkBB014. It is a simple template for a blog. Here is the link to the sparkBB014 Demo.

Now with all the prelimaries out of the way, here is what I did:

I wanted to achive a couple of things:

1 - Use a MasterPage
2 - Wrap the reusable/optional elements in UserControls
3 - Move all the data to the code behind so that users can easily be made dynamic.

So, I created a web project and added a master page to the project. Next I copied all the markup from between the body tags and copied it into the master page.

Then I pulled out each block of data and the surrounding markup out and replaced it with a ContentPlaceHolder. Then inside the Default.aspx for each ContentPlaceHolder I placed a corresponding Content tag and filled it with the data/markup I had just removed from the Master Page.

Once that was done, I started IDing and runat=servering html elements so that I could touch them programatically.

Seeing that the entire blog design scheme was repeated for each entry, I pulled the entire structure out into into own ascx UserControl.

And since I would not want the search area on every page I moved it as well to its own ascx UserControl.

Last but not least, I removed the actual data from the markup and coded the codebehind c# to dynamically load the data into the markup. So, here is the zip file containing the project and here is a link to the site hosted at 1&1. Please, tell me what you think!


Term Papers said...

I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards

Anonymous said...

Thanks for the info and it is very helpful. Hope others can also take advantage of it.
Css Web Templates