<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Amr Elsehemy</title>
    <description>Ideas and tips on C#, Custom Controls, ASP.NET, AJAX, GDI+ and more.</description>
    <link>http://amrelsehemy.net/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-GB</language>
    <blogChannel:blogRoll>http://amrelsehemy.net/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://amrelsehemy.net/syndication.axd</blogChannel:blink>
    <dc:creator>Amr Elsehemy</dc:creator>
    <dc:title>Amr Elsehemy</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><image><link>http://www.amrelsehemy.net</link><url>http://www.amrelsehemy.net/themes/Standard/avatar.jpg</url><title>Amr Elsehemy's Blog</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/AmrElsehemyBlog" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Happy Birthday MyBlog</title>
      <description>&lt;p&gt;Hello all, I know this blog has been idle for a long time, the reason is not I am becoming lazy or I don't have any more new ideas and topics to write about it just so happens I was quite *very* busy and unstable in my work the past few months.&lt;/p&gt; &lt;p&gt;But anyway I am still busy, but I think more stable and its time to manage my time more accurately to come back to the blogo-sphere again.&lt;/p&gt; &lt;p&gt;One year ago, 3rd of January 2008 I decided to buy the domain &lt;em&gt;&lt;strong&gt;amrelsehemy.net&lt;/strong&gt; &lt;/em&gt;to be my blog, before that I wasn't an active community member, after this year has gone I might have not participated much towards the community but at least I gained some valuable knowledge from it.&lt;/p&gt; &lt;p&gt;In 2008, &lt;/p&gt; &lt;p&gt;My top posts, I started my blog with a tutorial series to help custom controls developers to give their controls a rich &lt;a href="http://amrelsehemy.net/category/Design-Time-Support.aspx"&gt;design time support&lt;/a&gt; through 15 parts,&amp;nbsp; I will list them here.&lt;/p&gt; &lt;p&gt;Also, my &lt;a href="http://amrelsehemy.net/category/jBlogMvc.aspx"&gt;jBlogMvc&lt;/a&gt; small series had some audience and gained a lot of traffic, here are the posts.&lt;/p&gt; &lt;p&gt;2008 also witnessed some big change in my MCP transcript, after working with .net and Microsoft techs for a few years this summer I decided to get some certificates [MCPD : Enterprise and Web Developer] plus 4 other MCTS SharePoint certificates.&lt;/p&gt; &lt;p&gt;&lt;small&gt;(&lt;a href="https://mcp.microsoft.com/authenticate/validatemcp.aspx"&gt;https://mcp.microsoft.com/authenticate/validatemcp.aspx&lt;/a&gt; , Transcript ID (758580) and the Access Code (sehemyxx))&lt;/small&gt;&lt;/p&gt; &lt;p&gt;Other than studying and self improvement, I finished my post graduate studies and starting my masters point, I am researching around something related to the knowledge extraction from the web which will be very&amp;nbsp; related to web semantics and web ontology.&lt;/p&gt; &lt;p&gt;Career wise, I worked for &lt;a href="http://www.scs-me.com"&gt;SCS&lt;/a&gt; for three quarters then left to &lt;a href="http://www.itworx.com/"&gt;ITWorx&lt;/a&gt; . In parallel I also became a teaching assistant at my faculty (Faculty of Computer and Information Sciences - Ain Shams University), I thought till now 2 courses one on Digital Image Processing and the other on Basic Data Structures using C++, I also learned alot during this semester and built some basic data structures which I will find some time to share what I learned also built an image processing package a mini photo shop which also I will share one day.&lt;/p&gt; &lt;p&gt;About 2009,&lt;/p&gt; &lt;p&gt;The first thing on my mind is to get a new theme, to stand up with the new me.&lt;/p&gt; &lt;p&gt;For the time being, I think whenever I start blogging again it would be something near ASP.NET MVC or jQuery which both are considered the new kids on the block of the .NET web world.&lt;/p&gt; &lt;p&gt;I also have an application in my mind, I wish I have the time to do it and share my experience.&lt;/p&gt; &lt;p&gt;Happy new year all, and happy birthday my blog.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/Pv_O7aEJhDo" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/Pv_O7aEJhDo/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2009/01/04/Happy-Birthday-MyBlog.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=4e5a14f9-5af1-4eac-b0a4-899a6b877307</guid>
      <pubDate>Sun, 04 Jan 2009 14:26:24 -0700</pubDate>
      <category>My Site</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=4e5a14f9-5af1-4eac-b0a4-899a6b877307</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=4e5a14f9-5af1-4eac-b0a4-899a6b877307</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2009/01/04/Happy-Birthday-MyBlog.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=4e5a14f9-5af1-4eac-b0a4-899a6b877307</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=4e5a14f9-5af1-4eac-b0a4-899a6b877307</feedburner:origLink></item>
    <item>
      <title>jBlogMvc : part 3 Themable View Engine, Archive and Filtering by year, month and day</title>
      <description>&lt;blockquote&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;NOTE: &lt;/strong&gt;In this series I build a blogengine using ASP.NET MVC and jQuery from scratch in order to learn more about these new technologies. If you haven't read the &lt;/em&gt;&lt;em&gt;&lt;a href="http://amrelsehemy.net/post/2008/09/21/Introducing-jBlogMvc.aspx"&gt;first post in this series, I would encourage you do to that first&lt;/a&gt;&lt;/em&gt;&lt;em&gt;, or check out &lt;/em&gt;&lt;em&gt;&lt;a href="http://amrelsehemy.net/category/jBlogMvc.aspx"&gt;the jBlogMvc category&lt;/a&gt;&lt;/em&gt;&lt;em&gt;. You can also always &lt;a href="http://feeds.feedburner.com/AmrElsehemyBlog"&gt;subscribe to the feeds&lt;/a&gt;.&lt;/em&gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;jBlogMvc is converted to be used on &lt;strong&gt;ASP.NET MVC Beta 1&lt;/strong&gt; if you haven't downloaded it yet you can find it &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A24D1E00-CD35-4F66-BAA0-2362BDDE0766&amp;amp;displaylang=en"&gt;here&lt;/a&gt;, to read about the changes and additions in the beta 1 I do recommend reading &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/10/16/asp-net-mvc-beta-released.aspx"&gt;ScottGu's asp net mvc beta1 announcement&lt;/a&gt; if you haven't already read it.&lt;/p&gt; &lt;p&gt;This part had witnessed a big change in project structure hence the new release of the beta1 and building a themable folder structure as shown in the pic.&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="597" alt="solutionExplorer" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart3ThemableViewEngineArchivean_11B41/solutionExplorer_3.png" width="236" border="0"&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;I built a &lt;strong&gt;ThemableWebFormViewEngine&lt;/strong&gt; which now is responsible to find and create the Views to be rendered, the following listing shows the Theme View Engine&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:5791ab8c-e723-427e-940d-e6bbe5e58eb4" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="c#:firstline[1]"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Globalization;

namespace jBlogMvc.Utils
{
    public class ThemableWebFormViewEngine : WebFormViewEngine
    {
        public ThemableWebFormViewEngine()
        {
            base.ViewLocationFormats = new string[] {
                "~/Themes/{2}/{0}.aspx",
                "~/Themes/{2}/{0}.ascx",
                "~/Views/{1}/{0}.aspx",
                "~/Views/{1}/{0}.ascx",
                "~/Views/Shared/{0}.ascx",
                "~/Views/Shared/{0}.aspx"
            };

            base.MasterLocationFormats = new string[] {
                "~/Themes/{2}/{0}.master",
                "~/Views/{1}/{0}.master"
            };

            base.PartialViewLocationFormats = ViewLocationFormats;
        }

        public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName)
        {
            if (controllerContext == null)
            {
                throw new ArgumentNullException("controllerContext");
            }
            if (string.IsNullOrEmpty(viewName))
            {
                throw new ArgumentException("Value is required.", "viewName");
            }

            string themeName = GetTheme(controllerContext);

            string[] searchedViewLocations;
            string[] searchedMasterLocations;

            string controllerName = controllerContext.RouteData.GetRequiredString("controller");

            string viewPath = this.GetPath(this.ViewLocationFormats, viewName, controllerName, themeName, out searchedViewLocations);
            string masterPath = this.GetPath(this.MasterLocationFormats, viewName, controllerName, themeName, out searchedMasterLocations);

            if (!(string.IsNullOrEmpty(viewPath)) &amp;amp;&amp;amp; (!(masterPath == string.Empty) || string.IsNullOrEmpty(masterName)))
            {
                return new ViewEngineResult(this.CreateView(controllerContext, viewPath, masterPath), this);
            }
            return new ViewEngineResult(searchedViewLocations.Union&amp;lt;string&amp;gt;(searchedMasterLocations));
        }

        public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName)
        {
            if (controllerContext == null)
            {
                throw new ArgumentNullException("controllerContext");
            }
            if (string.IsNullOrEmpty(partialViewName))
            {
                throw new ArgumentException("Value is required.", partialViewName);
            }

            string themeName = GetTheme(controllerContext);

            string[] searchedLocations;

            string controllerName = controllerContext.RouteData.GetRequiredString("controller");

            string partialPath = this.GetPath(this.PartialViewLocationFormats, partialViewName, controllerName, themeName, out searchedLocations);

            if (string.IsNullOrEmpty(partialPath))
            {
                return new ViewEngineResult(searchedLocations);
            }
            return new ViewEngineResult(this.CreatePartialView(controllerContext, partialPath), this);
        }

        private string GetTheme(ControllerContext controllerContext)
        {
            string theme = controllerContext.HttpContext.Request.QueryString["theme"];
            if (controllerContext.RouteData.Values["Action"].ToString() == "ThemePreview" &amp;amp;&amp;amp;
             !string.IsNullOrEmpty(theme))
            {
                return theme;
            }
            else return Config.Instance.Theme;
        }

        private string GetPath(string[] locations, string viewName, string controllerName, string themeName, out string[] searchedLocations)
        {
            string path = null;

            searchedLocations = new string[locations.Length];

            for (int i = 0; i &amp;lt; locations.Length; i++)
            {
                path = string.Format(CultureInfo.InvariantCulture, locations[i], new object[] { viewName, controllerName, themeName });
                if (this.VirtualPathProvider.FileExists(path))
                {
                    searchedLocations = new string[0];
                    return path;
                }
                searchedLocations[i] = path;
            }
            return null;
        }

    }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This code is based on the work &lt;a href="http://pietschsoft.com/"&gt;Chris Pietschmann&lt;/a&gt; of &lt;a title="http://pietschsoft.com/post/2008/08/How-To-Setup-Custom-Theme-Support-In-ASPNET-MVC-using-a-Custom-ViewEngine.aspx" href="http://pietschsoft.com/post/2008/08/How-To-Setup-Custom-Theme-Support-In-ASPNET-MVC-using-a-Custom-ViewEngine.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The theme folder should contain the following views&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;site.master &lt;em&gt;"the overall look and feel"&lt;/em&gt; 
&lt;li&gt;Index.aspx &lt;em&gt;"for multi posts page"&lt;/em&gt; 
&lt;li&gt;archive.aspx &lt;em&gt;"archive page"&lt;/em&gt; 
&lt;li&gt;login.aspx &lt;em&gt;"login page"&lt;/em&gt; 
&lt;li&gt;single.aspx &lt;em&gt;"single post page"&lt;/em&gt; 
&lt;li&gt;_postview.acsx &lt;em&gt;"for the post template"&lt;/em&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;I also added in the Blog General Settings an option list for querying all themes available.&lt;/p&gt;
&lt;p&gt;I also added a ThemePreview action which you can preview how themes look with your posts without applying it, you can test the theme using a url like this &lt;a title="http://localhost:2113/themepreview?theme=Transparentia" href="http://localhost:2113/themepreview?theme=Transparentia"&gt;http://localhost:2113/themepreview?theme=Transparentia&lt;/a&gt; as you can see in the code above line 85, the method that decides which theme to render check first if the action themepreview is used and if there is a theme parameter in the query string.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Aslo jBlogMvc now supports the Archive page, when the posts get more and more readers like to have a page that has all the posts, and this is the description of the archive page, with an action like the following,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:9263595f-73c7-490b-8fbe-a1d46c7e7b21" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="c#"&gt;public ActionResult Archive()
{
    var posts = _repository.GetPostList();
    return View(posts);
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and a simple view, that renders a table of posts titles and dates.&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:ac4704cc-8437-467b-9e30-c8e7830f7283" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Indigo/Site.Master" AutoEventWireup="true" CodeBehind="Archive.aspx.cs" Inherits="jBlogMvc.Themes.Indigo.Archive" %&amp;gt;
&amp;lt;asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"&amp;gt;
    &amp;lt;h1&amp;gt;Archive&amp;lt;/h1&amp;gt;
    &amp;lt;div class="item"&amp;gt;
    &amp;lt;%if (ViewData.Model == null || ViewData.Model.Count &amp;lt;= 0)
      {%&amp;gt;
    &amp;lt;h2&amp;gt;No Posts published yet.&amp;lt;/h2&amp;gt;
    &amp;lt;% }
      else{%&amp;gt;
    &amp;lt;table width="100%"&amp;gt;
    &amp;lt;thead&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;th align="left"&amp;gt;Title&amp;lt;/th&amp;gt;&amp;lt;th &amp;gt;Date&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/thead&amp;gt;
    &amp;lt;tbody&amp;gt;
    &amp;lt;%
        foreach (var post in ViewData.Model)
        {%&amp;gt;
            &amp;lt;tr&amp;gt;
            &amp;lt;td style="width:80%"&amp;gt;&amp;lt;h3&amp;gt;&amp;lt;a href="&amp;lt;%=post.RelativeLink %&amp;gt;"&amp;gt;&amp;lt;%=post.Title%&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h3&amp;gt;&amp;lt;/td&amp;gt;
            &amp;lt;td style="width:20%" align="right"&amp;gt;&amp;lt;h3&amp;gt;&amp;lt;%=post.CDate.ToString("dd.MMM yyyy")%&amp;gt;&amp;lt;/h3&amp;gt;&amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
        &amp;lt;%}
    %&amp;gt;
    &amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;
    &amp;lt;%} %&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/asp:Content&amp;gt;

&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Filtering Posts by Date using url&lt;/h3&gt;
&lt;p&gt;Also I added date filtering in url so that you can query posts by date like this &lt;/p&gt;
&lt;p&gt;&lt;a title="http://localhost:2113/posts/2008/9/24" href="http://localhost:2113/posts/2008/9/24"&gt;http://localhost:2113/posts/2008/9/24&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or&lt;/p&gt;
&lt;p&gt;&lt;a title="http://localhost:2113/posts/2008/9" href="http://localhost:2113/posts/2008/9"&gt;http://localhost:2113/posts/2008/9&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or&lt;/p&gt;
&lt;p&gt;&lt;a title="http://localhost:2113/posts/2008/9/24" href="http://localhost:2113/posts/2008/"&gt;http://localhost:2113/posts/2008/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This was done by adding the following route in the route table at application start&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:cdd1c1eb-c6ae-48a4-9887-98bcdd445f92" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="c#"&gt;routes.MapRoute(
    "Calendar",
    "posts/{year}/{month}/{day}",
    new { controller = "Home", action = "Index", id = "", year = "", month = "", day = "" }
);&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Some Changes&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;PostBinder&lt;/strong&gt; class is no longer used, I grabbed this part from Scott's announcement&lt;font face="arial" size="2"&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Preview 5 introduced the concept of "model binders" - which allow you to map incoming form post values to complex .NET types passed as Controller action method parameters.&amp;nbsp; Model binders in preview 5 were extensible, and you could create custom binders and register them at multiple levels of the system.&amp;nbsp; Preview 5 didn't ship with any "pre-built" binders, though, that you could use out of the box (you instead had to build your own).&amp;nbsp; Today's beta now includes a built-in, pre-registered, binder that can be used to automatically handle standard .NET types - without requiring any additional code or registration. &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;You can see how the AddPost action in the AdminController accepts a Post parameter just as before now with now binders, however, you can see me using &lt;strong&gt;Bind&lt;/strong&gt; attribute on the post with a parameter Prefix so why?, the out of box implementation will use parameter name "p" in this case and find in the form post collection for p.body, p.title, p.slug and so on, so the developer can override this default behavior by using this attribute, here I am sending an empty prefix so it should find form post variables named body, title and so on.&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:7dcb4bff-a97a-4332-9d22-32144970def1" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="c#:nocontrols"&gt;public ActionResult AddPost([Bind(Prefix="")]Post p)
{
    if (!ViewData.ModelState.IsValid)
        return View("WritePost", p);

    try
    {
        _repository.InsertPost(p);
        return RedirectToRoute("Posts", new { slug = p.Slug });
    }
    catch
    {
        Helpers.UpdateModelStateWithViolations(p, ViewData.ModelState, System.Data.Linq.ChangeAction.Insert);
        return View("WritePost", p);
    }
}&lt;/pre&gt;&lt;/div&gt;&lt;/font&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;So what do you think? you are most welcomed to leave comments. &lt;/p&gt;
&lt;p&gt;Download version one : &lt;a href="http://amrelsehemy.net/file.axd?file=2008%2f10%2fjBlogMvc_version_3.zip"&gt;jBlogMvc_version_3.zip&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you liked this blog post then please &lt;strong&gt;&lt;a href="http://feeds.feedburner.com/AmrElsehemyBlog"&gt;subscribe&lt;/a&gt;&lt;/strong&gt; to this blog. &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/ReGTdzdyY_U" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/ReGTdzdyY_U/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/10/28/jBlogMvc-part-3-Themable-View-Engine-Archive-and-Filtering-by-year-month-and-day.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=f5f0e573-bc46-45a7-9470-e57ea13b567b</guid>
      <pubDate>Tue, 28 Oct 2008 14:18:20 -0700</pubDate>
      <category>jBlogMvc</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=f5f0e573-bc46-45a7-9470-e57ea13b567b</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=f5f0e573-bc46-45a7-9470-e57ea13b567b</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/10/28/jBlogMvc-part-3-Themable-View-Engine-Archive-and-Filtering-by-year-month-and-day.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=f5f0e573-bc46-45a7-9470-e57ea13b567b</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=f5f0e573-bc46-45a7-9470-e57ea13b567b</feedburner:origLink></item>
    <item>
      <title>jBlogMvc : part 2 Editing, Deleting, Paging Posts and Rss feeds</title>
      <description>&lt;blockquote&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;NOTE: &lt;/strong&gt;In this series I build a blogengine using ASP.NET MVC and jQuery from scratch in order to learn more about these new technologies. If you haven't read the &lt;/em&gt;&lt;em&gt;&lt;a href="http://amrelsehemy.net/post/2008/09/21/Introducing-jBlogMvc.aspx"&gt;first post in this series, I would encourage you do to that first&lt;/a&gt;&lt;/em&gt;&lt;em&gt;, or check out &lt;/em&gt;&lt;em&gt;&lt;a href="http://amrelsehemy.net/category/jBlogMvc.aspx"&gt;the jBlogMvc category&lt;/a&gt;&lt;/em&gt;&lt;em&gt;. You can also always &lt;a href="http://feeds.feedburner.com/AmrElsehemyBlog"&gt;subscribe to the feeds&lt;/a&gt;.&lt;/em&gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;What about new features this part will cover : &lt;/p&gt; &lt;ol&gt; &lt;li&gt;Configuration is saved in the database.  &lt;li&gt;Managing Posts (Editing, Deleting).  &lt;li&gt;Posts are now paged.  &lt;li&gt;Some jquery magic is used. &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;So, lets have a tour in the project one more time.  &lt;/p&gt; &lt;h3&gt;Database&lt;/h3&gt; &lt;p&gt;Database has now a new table to read and write the blog settings. &lt;/p&gt; &lt;p&gt;The project design has changed I applied the Repository Pattern (as recommended in some feedback) , so know I have an extra layer I don't plan on supporting other data stores but its a good practice (anyway this series is to learn). &lt;/p&gt; &lt;h3&gt;Helpers&lt;/h3&gt; &lt;p&gt;Pagination is added it has been discussed many times I will not repeat the code I got over here, for more about paging in ASP.NET MVC check the following excellent posts &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://weblogs.asp.net/stephenwalther/archive/2008/09/18/asp-net-mvc-tip-44-create-a-pager-html-helper.aspx"&gt;Stephen Walther Paging Tip&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.taiga.nl/martijn/archive/2008/08/27/paging-with-asp.net-mvc.aspx"&gt;Martijn Boland paging sample&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.squaredroot.com/post/2008/07/08/PagedList-Strikes-Back.aspx"&gt;Troy Goode also Strikes Back with his PagedList&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt; &lt;h3&gt;Models&lt;/h3&gt; &lt;p&gt;IBlogRepository and its implementation were added to this folder, the IBlogRepository is as listed here &lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:0b1600ce-01af-4d99-8289-b2fdc814bd2c" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="c#:nogutter:nocontrols"&gt;public interface IBlogRepository
{
    #region Posts
    Post GetPostBySlug(string slug);
    Post GetPostByPemalink(Guid premalink);
    PagedList&amp;lt;Post&amp;gt; GetPostList(int pageIndex, int pageSize);

    void InsertPost(Post p);
    void UpdatePost(Post p);
    void DeletePost(Post p);
    #endregion

    #region Settings
    void SaveSetting(Setting s);
    Setting GetSetting(string settingKey);
    #endregion
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;h3&gt;Controllers&lt;/h3&gt;
&lt;p&gt;Still having the main two controllers (Home and Admin)&amp;nbsp; but many changes have came through, due to changing the structure and using repository. &lt;/p&gt;
&lt;p&gt;Home Controller now sends a PagedList rather an ordinary List to the View, and I added a feed action which returns rss feeds of the blog as shown below &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:fec2be30-903b-4a7f-92ee-9776ecf5ef7a" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="c#:nogutter:nocontrols"&gt;public ActionResult Feed()
{
    XDocument document = new XDocument(
        new XDeclaration("1.0", "utf-8", null),
            new XElement("rss",
                    new XElement("channel",
                        new XElement("title", Config.Instance.BlogName),
                        new XElement("link", "http://www.northwindtraders.com"),
                        new XElement("description", Config.Instance.BlogDescription),

                        from post in _repository.GetPostList(0, Config.Instance.BlogSyndicationFeeds)
                        orderby post.CDate descending
                        select new XElement("item",
                            new XElement("title", post.Title),
                            new XElement("description", post.Body),
                            new XElement("link", Request.Url.GetLeftPart(UriPartial.Authority) + post.RelativeLink)
                            )
                       ), new XAttribute("version", "2.0")));
    StringWriter sb = new StringWriter();
    document.Save(sb);

    return Content(sb.ToString(), "text/xml", Encoding.UTF8);
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Admin Controller has a lot of additions as shown in the code listing. &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:528d76eb-aa7a-4659-8a4c-adc9b14d6200" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="c#:nogutter"&gt;[AcceptVerbs("GET")]
public ActionResult EditPost(Guid? id)
{
    if (!id.HasValue) return RedirectToAction("ManagePosts");
    Post p = _repository.GetPostByPemalink(id.Value);
    if (p == null) return RedirectToAction("ManagePosts");
    return View(p);
}

[AcceptVerbs("POST")]
public ActionResult UpdatePost(Guid id)
{
    Post p = _repository.GetPostByPemalink(id);
    if (!ViewData.ModelState.IsValid)
        return View("ManagePosts", p);

    try
    {
        UpdateModel(p, new string[] { "Title", "Body", "Slug", "CDate" });
        _repository.UpdatePost(p);
        return RedirectToRoute("Posts", new { slug = p.Slug });
    }
    catch
    {
        Helpers.UpdateModelStateWithViolations(p, ViewData.ModelState, System.Data.Linq.ChangeAction.Update);
        return View("ManagePosts", p);
    }
}

[AcceptVerbs("GET")]
public ActionResult DeletePost(Guid? id)
{
    if (!id.HasValue) return RedirectToAction("ManagePosts");
    Post p = _repository.GetPostByPemalink(id.Value);
    if (p == null) return RedirectToAction("ManagePosts");
    return View(p);
}

[AcceptVerbs("POST")]
public ActionResult RemovePost(Guid id)
{
    Post p = _repository.GetPostByPemalink(id);
    if (!ViewData.ModelState.IsValid)
        return View("ManagePosts", p);

    try
    {
        _repository.DeletePost(p);
        return RedirectToAction("ManagePosts");
    }
    catch
    {
        Helpers.UpdateModelStateWithViolations(p, ViewData.ModelState, System.Data.Linq.ChangeAction.Insert);
        return View("ManagePosts", p);
    }
}

public ActionResult ManagePosts(int? page)
{
    var posts = _repository.GetPostList(page ?? 0, 25);
    return View(posts);
}

public ActionResult GeneralSettings()
{
    return View();
}
public ActionResult ReadingSettings()
{
    return View();
}&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Views&lt;/h3&gt;
&lt;p&gt;A lot of views were added in this part 2 other nested master pages have been added Admin_Manage and Admin_Settings for managing blog content and settings respectively some content views were added too. &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;ManagePosts : Grid for all posts. 
&lt;li&gt;EditPost : editing a post. 
&lt;li&gt;DeletePost : confirm deleting a post. 
&lt;li&gt;GeneralSettings : Blog Name, Blog description. 
&lt;li&gt;ReadingSettings : Posts per page, syndication count. &lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;I will not copy and paste code here, please take a look at the attached project.&lt;/p&gt;
&lt;h3&gt;jQuery&lt;/h3&gt;
&lt;p&gt;This part didn't miss some of the jQuery magic as well, I found another interesting plugin called &lt;a title="jeditable inline editing" href="http://www.appelsiini.net/projects/jeditable" target="_blank"&gt;jEditable&lt;/a&gt; which allows ajax inline editing, its pretty cool and small, all you need to start using it, is an Action that accepts POST verbs and returns some value. &lt;/p&gt;
&lt;p&gt;I used it here with the (Settings) panel to read and write blog settings, the following code snippet is from the GeneralSettings.aspx view page defined in the document ready event. &lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:c927b9f7-a5f3-40b2-a5f8-07b623b08743" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="js:nogutter:nocontrols"&gt;$("#blogname").editable('&amp;lt;%=Url.Action("UpdateSettings","Admin") %&amp;gt;', {
               submit: 'ok',
               cancel: 'cancel',
               cssclass: 'editable',
               width: '99%',
               placeholder: 'emtpy',
               indicator: "&amp;lt;img src='../../Content/img/indicator.gif'/&amp;gt;"
           });&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:4ccfbb4b-63a5-4ac4-814d-2f1a6b94746d" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="xml:nogutter:nocontrols"&gt;&amp;lt;p&amp;gt;
    &amp;lt;label for="blogname"&amp;gt;Blog Name&amp;lt;/label&amp;gt;
    &amp;lt;span class="edt" id="blogname"&amp;gt;&amp;lt;%=Html.Encode(jBlogMvc.Config.Instance.BlogName)%&amp;gt;&amp;lt;/span&amp;gt;
&amp;lt;/p&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Its clear that this code snippet assigns the textbox with id &lt;em&gt;blogname&lt;/em&gt; to an action called UpdateSettings found in the Admin controller, shown in the next code snippet &lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:b645124c-dc1d-4441-a67b-1fa6138e90af" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre name="code" class="c#:nogutter:nocontrols"&gt;[AcceptVerbs("POST")]
public ActionResult UpdateSettings(string id, string value)
{
    foreach (var item in this.GetType().GetProperties())
    {
        if (item.Name.ToLower().Equals(id, StringComparison.InvariantCultureIgnoreCase))
            item.SetValue(Config.Instance, value, null);
    }
    return Content(value);
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="156" alt="inline editing" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart2_D514/inline%20editing_5.png" width="660" border="0"&gt; &lt;/p&gt;
&lt;p&gt;So, in the action I accept two parameters sent id and value, sent by default by the jEditable plugin which can be configured to change the variable names, the action is expecting that there is a blogsetting&amp;nbsp; in the Settings table having a key macthing the id parameter for example (blogname), which I also expect having a matching Property name in the Config class (built using the singleton pattern). &lt;/p&gt;
&lt;p&gt;I am pretty sure that this is not the best practice for this case, thats why I am in need for constructive feedback. &lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;And that's all for this part, I have more and more features coming while writing this engine I have learned much till now, hope someone is learning with me too. &lt;/p&gt;
&lt;p&gt;In this part, I used some features of the ASP.NET MVC to complete the administration area I started last, jQuery too was used to make inline editing (jEditable plugin) so what do you think? you are most welcomed to leave comments. &lt;/p&gt;
&lt;p&gt;Download version one : &lt;a href="http://amrelsehemy.net/file.axd?file=2008%2f10%2fjBlogMvc_version_2.zip"&gt;jBlogMvc_version_2.zip&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you liked this blog post then please &lt;strong&gt;&lt;a href="http://feeds.feedburner.com/AmrElsehemyBlog"&gt;subscribe&lt;/a&gt;&lt;/strong&gt; to this blog. &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/0FxTsECWy1Y" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/0FxTsECWy1Y/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/10/05/jBlogMvc-part-2-editing-deleting-paging-posts-rss-feeds.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=094d619d-a1f9-43c3-9812-5271cc11a5f8</guid>
      <pubDate>Sun, 05 Oct 2008 15:12:04 -0700</pubDate>
      <category>jBlogMvc</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=094d619d-a1f9-43c3-9812-5271cc11a5f8</pingback:target>
      <slash:comments>8</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=094d619d-a1f9-43c3-9812-5271cc11a5f8</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/10/05/jBlogMvc-part-2-editing-deleting-paging-posts-rss-feeds.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=094d619d-a1f9-43c3-9812-5271cc11a5f8</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=094d619d-a1f9-43c3-9812-5271cc11a5f8</feedburner:origLink></item>
    <item>
      <title>jBlogMvc : part 1 Building the Administration Area</title>
      <description>&lt;blockquote&gt;
							 						
	&lt;p&gt;
							&lt;em&gt;&lt;strong&gt;NOTE: &lt;/strong&gt;In this series I build a blogengine using ASP.NET MVC and jQuery from scratch in order to learn more about these new technologies. If you haven&amp;#39;t read the &lt;/em&gt;&lt;em&gt;&lt;a href="http://amrelsehemy.net/post/2008/09/21/Introducing-jBlogMvc.aspx"&gt;first post in this series, I would encourage you do to that first&lt;/a&gt;&lt;/em&gt;&lt;em&gt;, or check out &lt;/em&gt;&lt;em&gt;&lt;a href="http://amrelsehemy.net/category/jBlogMvc.aspx"&gt;the jBlogMvc category&lt;/a&gt;&lt;/em&gt;&lt;em&gt;. You can also always &lt;a href="http://feeds.feedburner.com/AmrElsehemyBlog"&gt;subscribe to the feeds&lt;/a&gt;.&lt;/em&gt;						
	&lt;/p&gt;
&lt;/blockquote&gt;
 
&lt;p&gt;
In this part of the series, I build the administration area of the blog engine I am building using the ASP.NET MVC and jQuery, in this part I will cover more basic features used in any blog engine, so lets get started.  
&lt;/p&gt;
&lt;h3&gt;What will part 1 cover ?&lt;/h3&gt; 
&lt;p&gt;
Basically it will cover how to build an administration area, I chose the &lt;a href="http://wordpress.org"&gt;wordpress&lt;/a&gt; blog engine and tried to clone its structure and some look and feel of it, the operations I will implement in this part will be :
&lt;/p&gt;
 
&lt;ul&gt;
							 						
	&lt;li&gt;Visitor  						
	&lt;ul&gt;
														 												
		&lt;li&gt;Login -- I will just reuse the code available with the default project template for membership stuff.&lt;/li&gt;						
	&lt;/ul&gt;
							 &lt;/li&gt;						
	&lt;li&gt;Admin  						
	&lt;ul&gt;
														 												
		&lt;li&gt;Logout  &lt;/li&gt;												
		&lt;li&gt;Add Post&lt;/li&gt;						
	&lt;/ul&gt;
							&lt;/li&gt;
&lt;/ul&gt;
 
&lt;p&gt;
The stuff I collected and used all over the net from blogs and used in this part can be summarized in the following,
&lt;/p&gt;
 
&lt;ol&gt;
							 						
	&lt;li&gt;Using membership for validation  &lt;/li&gt;						
	&lt;li&gt;Using the Authorize attribute  &lt;/li&gt;						
	&lt;li&gt;Using Model Binders  &lt;/li&gt;						
	&lt;li&gt;jQuery Client validation  &lt;/li&gt;						
	&lt;li&gt;Small validation framework for business rules and server side validation.(originally written by scott gu)  &lt;/li&gt;						
	&lt;li&gt;Using nested master pages in ASP.NET MVC  &lt;/li&gt;						
	&lt;li&gt;Applying the &lt;a href="http://en.wikipedia.org/wiki/Post/Redirect/Get"&gt;&amp;quot;Post/Redirect/Get&amp;quot; (aka PRG) pattern&lt;/a&gt;.  &lt;/li&gt;						
	&lt;li&gt;Applying some css to make it look nice (based on &lt;a href="http://wordpress.org"&gt;wordpress blogengine&lt;/a&gt; admin layout) &lt;br /&gt;
	&lt;/li&gt;
&lt;/ol&gt;
 
&lt;p&gt;
To hold your interest the final look of the administration area will look like this :
&lt;/p&gt;
 
&lt;p&gt;
&lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart1BuildingtheAdministrationAr_E9F7/admin%20area_4.png"&gt;&lt;img style="border-width: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart1BuildingtheAdministrationAr_E9F7/admin%20area_thumb_1.png" border="0" alt="admin area" width="640" height="436" /&gt;&lt;/a&gt; 
&lt;/p&gt;
 
&lt;h3&gt;Ok Lets see some code&lt;/h3&gt; 
&lt;p&gt;
What&amp;#39;s new in version 1 :
&lt;/p&gt;
 
&lt;h3&gt;Routes&lt;/h3&gt; 
&lt;p&gt;
Routes now include an extra route for directing users to the admin area
&lt;/p&gt;
&lt;p&gt;
&lt;div class="code"&gt;
[code:c#]&amp;nbsp;
&lt;/p&gt;
 
&lt;p&gt;
routes.MapRoute(&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;Admin&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;admin/{action}&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;new&lt;/span&gt; { controller = &amp;quot;Admin&amp;quot;, action = &amp;quot;Index&amp;quot; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; );
&lt;/p&gt;
&lt;p&gt;
[/code]&lt;/div&gt;&amp;nbsp;
&lt;/p&gt;
&lt;h3&gt;Models&lt;/h3&gt; 
&lt;p&gt;
No new models were added as the database remains as it is, however, I like to highlight a new feature available in the Preview 5, &lt;strong&gt;ModelBinders&lt;/strong&gt;, although &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx"&gt;ScottGu just mentioned&lt;/a&gt; that the team has not yet finalized and will be changed in the beta version.
&lt;/p&gt;
 
&lt;blockquote&gt;
							 						
	&lt;p&gt;
							&lt;em&gt;Note: the MVC team plans to tweak the IModelBinder interface further for the next drop (they recently discovered a few scenarios that necessitate a few changes).&amp;nbsp; So if you build a custom model binder with preview 5 expect to have to make a few tweaks when the next drop comes out (probably nothing too major - but just a heads up that we know a few arguments will change on its methods). By ScottGu&lt;/em&gt;						
	&lt;/p&gt;
&lt;/blockquote&gt;
 
&lt;blockquote&gt;
							 						
	&lt;p&gt;
							ModelBinders, which is provided to allow Action methods to take complex types as their parameters. Previously, action methods were only able to take simple types such as strings and integers as their parameters. The new ModelBinder provides the facility to build complex types from component parts that (for example) may be part the result of submitting a form with several fields.						
	&lt;/p&gt;
							 						
	&lt;p&gt;
							&lt;em&gt;Learn more about ModelBinders from &lt;/em&gt;&lt;a href="http://weblogs.asp.net/melvynharbour/archive/2008/08/29/how-to-use-the-asp-net-mvc-modelbinder.aspx"&gt;&lt;em&gt;Melvyn Harbour&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, &lt;/em&gt;&lt;a href="http://www.singingeels.com/Articles/Model_Binders_in_ASPNET_MVC.aspx"&gt;&lt;em&gt;Timothy Khouri&lt;/em&gt;&lt;/a&gt;&lt;em&gt; and &lt;/em&gt;&lt;a href="http://blog.maartenballiauw.be/post/2008/09/01/Using-the-ASPNET-MVC-ModelBinder-attribute.aspx"&gt;&lt;em&gt;Maarten Balliauw&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;						
	&lt;/p&gt;
&lt;/blockquote&gt;
 
&lt;p&gt;
The following code listing is from the PostBinder
&lt;/p&gt;
 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;div class="code"&gt;
[code:c#]&amp;nbsp;
&lt;/p&gt;
 
&lt;p&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; PostBinder : IModelBinder&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Concat(&lt;span class="kwrd"&gt;string&lt;/span&gt; modelName, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; (String.IsNullOrEmpty(modelName)) ? propertyName : modelName + &amp;quot;.&amp;quot; + propertyName;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; T LookupValue&amp;lt;T&amp;gt;(ControllerContext controllerContext, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, ModelStateDictionary modelState)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IModelBinder binder = ModelBinders.GetBinder(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(T));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt; = binder.GetValue(controllerContext, propertyName, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(T), modelState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; (&lt;span class="kwrd"&gt;value&lt;/span&gt; &lt;span class="kwrd"&gt;is&lt;/span&gt; T) ? (T)&lt;span class="kwrd"&gt;value&lt;/span&gt; : &lt;span class="kwrd"&gt;default&lt;/span&gt;(T);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; GetValue(ControllerContext controllerContext, &lt;span class="kwrd"&gt;string&lt;/span&gt; modelName, Type modelType, ModelStateDictionary modelState)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;if&lt;/span&gt; (controllerContext == &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&amp;quot;controllerContext&amp;quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;if&lt;/span&gt; (modelType != &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(Post))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentException(&amp;quot;This binder only works with Post models.&amp;quot;, &amp;quot;modelType&amp;quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;// Instantiate a post object, then bind values to each property&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Post p = &lt;span class="kwrd"&gt;new&lt;/span&gt; Post()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title = LookupValue&amp;lt;String&amp;gt;(controllerContext, Concat(&lt;span class="kwrd"&gt;null&lt;/span&gt;, &amp;quot;Title&amp;quot;), modelState),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Body = LookupValue&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt;(controllerContext, Concat(&lt;span class="kwrd"&gt;null&lt;/span&gt;, &amp;quot;Body&amp;quot;), modelState),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Slug = LookupValue&amp;lt;String&amp;gt;(controllerContext, Concat(&lt;span class="kwrd"&gt;null&lt;/span&gt;, &amp;quot;Slug&amp;quot;), modelState),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CDate= LookupValue&amp;lt;DateTime&amp;gt;(controllerContext, Concat(&lt;span class="kwrd"&gt;null&lt;/span&gt;, &amp;quot;CDate&amp;quot;), modelState)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; p;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }  
&lt;/p&gt;
&lt;p&gt;
}
&lt;/p&gt;
&lt;p&gt;
[/code]&lt;/div&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
Don&amp;#39;t forget to register the Binder (there are four ways to register, check &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx"&gt;ScottGu&amp;#39;s post&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
&lt;div class="code"&gt;
[code:c#]&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Application_Start()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModelBinders.Binders[&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(Post)] = &lt;span class="kwrd"&gt;new&lt;/span&gt; PostBinder();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RegisterRoutes(RouteTable.Routes); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p&gt;
[/code]&lt;/div&gt;&amp;nbsp;
&lt;/p&gt;
&lt;h3&gt;Controllers&lt;/h3&gt; 
&lt;p&gt;
In this part, the AdminController appears to hold,&amp;nbsp; the admin tasks, which till now only include the following actions.
&lt;/p&gt;
 
&lt;ul&gt;
							 						
	&lt;li&gt;index : a default action redirects to the write action.  &lt;/li&gt;						
	&lt;li&gt;write : an action to be responsible for writing things (only have posts now), so it just redirects to posts.  &lt;/li&gt;						
	&lt;li&gt;writepost : renders a view to enable authenticated users to write posts and publish it.  &lt;/li&gt;						
	&lt;li&gt;addpost : a &lt;em&gt;Http Post &lt;/em&gt;action which inserts the new post into the database.&lt;/li&gt;
&lt;/ul&gt;
 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;div class="code"&gt;
[code:c#]&amp;nbsp;
&lt;/p&gt;
 
&lt;p&gt;
[Authorize]&lt;br /&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AdminController : Controller&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; jBlogMvcDataContext jbdc = &lt;span class="kwrd"&gt;new&lt;/span&gt; jBlogMvcDataContext();  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Index()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;//just a default redirection&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;//maybe in future this should be configurable&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; RedirectToAction(&amp;quot;Write&amp;quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Write()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;//just a default redirection&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;//maybe in future this should be configurable&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; RedirectToAction(&amp;quot;WritePost&amp;quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [AcceptVerbs(&amp;quot;GET&amp;quot;)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult WritePost()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Post p = &lt;span class="kwrd"&gt;new&lt;/span&gt; Post();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(p);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [AcceptVerbs(&amp;quot;POST&amp;quot;)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult AddPost(Post p)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;if&lt;/span&gt; (!ViewData.ModelState.IsValid)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(&amp;quot;WritePost&amp;quot;, p);  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Helpers.InsertPost(p);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; RedirectToRoute(&amp;quot;Posts&amp;quot;, &lt;span class="kwrd"&gt;new&lt;/span&gt; { slug = p.Slug });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;catch&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Helpers.UpdateModelStateWithViolations(p, ViewData.ModelState,System.Data.Linq.ChangeAction.Insert);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(&amp;quot;WritePost&amp;quot;, p);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}
&lt;/p&gt;
&lt;p&gt;
[/code]&lt;/div&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
More over, HomeController now has 2 more extra actions :
&lt;/p&gt;
 
&lt;ul&gt;
							 						
	&lt;li&gt;login  &lt;/li&gt;						
	&lt;li&gt;logout&lt;/li&gt;
&lt;/ul&gt;
 
&lt;p&gt;
just copied from the default template nothing new added.
&lt;/p&gt;
 
&lt;h3&gt;Views&lt;/h3&gt; 
&lt;p&gt;
A lot of views are added this part, actually I am trying nesting master pages, one for the admin area overall, and the other for each module (like: write, manage, .. and so in wordpress), so I added :
&lt;/p&gt;
 
&lt;ul&gt;
							 						
	&lt;li&gt;admin.master  &lt;/li&gt;						
	&lt;li&gt;admin_write.master  &lt;/li&gt;						
	&lt;li&gt;writepost.aspx  &lt;/li&gt;						
	&lt;li&gt;login.aspx  &lt;/li&gt;						
	&lt;li&gt;_loginWidget.acsx&lt;/li&gt;
&lt;/ul&gt;
 
&lt;p&gt;
writepost.aspx
&lt;/p&gt;
 
&lt;div class="code"&gt;
&lt;p&gt;
&amp;lt;%@ Page Title=&amp;quot;Write Post&amp;quot; Language=&amp;quot;C#&amp;quot; MasterPageFile=&amp;quot;~/Views/Admin/Admin_Write.Master&amp;quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;WritePost.aspx.cs&amp;quot; Inherits=&amp;quot;jBlogMvc.Views.Admin.WritePost&amp;quot; %&amp;gt;  
&lt;/p&gt;
&lt;p&gt;
&amp;lt;asp:Content ContentPlaceHolderID=&amp;quot;head&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(function() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&amp;quot;#fields&amp;quot;).validate();});&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;  
&lt;/p&gt;
&lt;p&gt;
&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;
&amp;lt;asp:Content ContentPlaceHolderID=&amp;quot;MainContent&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h2&amp;gt;Write Post&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id=&amp;quot;fields&amp;quot; action=&amp;quot;&amp;lt;%=Url.Action(&amp;quot;AddPost&amp;quot;,&amp;quot;Admin&amp;quot;)%&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;table cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id=&amp;quot;postfields&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;label for=&amp;quot;title&amp;quot;&amp;gt;Title&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.TextBox(&amp;quot;Title&amp;quot;, new { id=&amp;quot;title&amp;quot;,@class=&amp;quot;required&amp;quot;})%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.ValidationMessage(&amp;quot;Title&amp;quot;)%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;label for=&amp;quot;body&amp;quot;&amp;gt;Body&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.TextArea(&amp;quot;Body&amp;quot;, new { id = &amp;quot;body&amp;quot;, rows = &amp;quot;6&amp;quot;, cols = &amp;quot;50&amp;quot;, @class = &amp;quot;required&amp;quot; })%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.ValidationMessage(&amp;quot;Body&amp;quot;)%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;label for=&amp;quot;slug&amp;quot;&amp;gt;Slug&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.TextBox(&amp;quot;Slug&amp;quot;, new { id = &amp;quot;slug&amp;quot;, @class = &amp;quot;required&amp;quot; })%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.ValidationMessage(&amp;quot;Slug&amp;quot;)%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;label for=&amp;quot;cdate&amp;quot;&amp;gt;Creation Date&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.TextBox(&amp;quot;CDate&amp;quot;, ViewData.Model.CDate.ToString(&amp;quot;MM/dd/yyyy&amp;quot;),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new { id = &amp;quot;cdate&amp;quot;, @class = &amp;quot;required date&amp;quot; })%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.ValidationMessage(&amp;quot;CDate&amp;quot;)%&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td id=&amp;quot;tdsubmitbox&amp;quot; valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id=&amp;quot;submitbox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;positive&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;img src=&amp;quot;../../Content/icons/tick.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;Publish&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/asp:Content&amp;gt;  
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
_loginWidget.ascx  
&lt;/p&gt;
&lt;p&gt;
And it looks like this  
&lt;/p&gt;
&lt;p&gt;
logged in view&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logged off  
&lt;/p&gt;
&lt;p&gt;
&lt;img style="border-width: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart1BuildingtheAdministrationAr_E9F7/logged%20in%20widget_6.png" border="0" alt="logged in widget" width="220" height="120" /&gt; &lt;img style="border-width: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart1BuildingtheAdministrationAr_E9F7/not%20logged%20in_3.png" border="0" alt="not logged in" width="220" height="120" /&gt; 
&lt;/p&gt;
 
&lt;h3&gt;Utils&lt;/h3&gt; 
&lt;p&gt;
I added some code to perform the validation logic for custom business rules, this is the simplest implementation for this task copied from ScottGu&amp;#39;s post, for more complex implementation scenarios I strongly recommend the following posts, 
&lt;/p&gt;
 
&lt;ul&gt;
							 						
	&lt;li&gt;&lt;a href="http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/" title="http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/"&gt;http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/&lt;/a&gt;  &lt;/li&gt;						
	&lt;li&gt;&lt;a href="http://blog.maartenballiauw.be/post/2008/08/29/Form-validation-with-ASPNET-MVC-preview-5.aspx" title="http://blog.maartenballiauw.be/post/2008/08/29/Form-validation-with-ASPNET-MVC-preview-5.aspx"&gt;http://blog.maartenballiauw.be/post/2008/08/29/Form-validation-with-ASPNET-MVC-preview-5.aspx&lt;/a&gt;,  &lt;/li&gt;						
	&lt;li&gt;&lt;a href="http://blog.codeville.net/2008/04/30/model-based-client-side-validation-for-aspnet-mvc/" title="http://blog.codeville.net/2008/04/30/model-based-client-side-validation-for-aspnet-mvc/"&gt;http://blog.codeville.net/2008/04/30/model-based-client-side-validation-for-aspnet-mvc/&lt;/a&gt;  &lt;/li&gt;						
	&lt;li&gt;&lt;a href="http://blog.codeville.net/2008/09/08/thoughts-on-validation-in-aspnet-mvc-applications/" title="http://blog.codeville.net/2008/09/08/thoughts-on-validation-in-aspnet-mvc-applications/"&gt;http://blog.codeville.net/2008/09/08/thoughts-on-validation-in-aspnet-mvc-applications/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
 
&lt;p&gt;
For client side jquery I used the &lt;a href="http://docs.jquery.com/Plugins/Validation/Validator"&gt;validation plugin found here&lt;/a&gt;, Server side I used the small framework scott gu wrote in his post for simplicity.
&lt;/p&gt;
 
&lt;p&gt;
&lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart1BuildingtheAdministrationAr_E9F7/Client%20side%20validation_2.png"&gt;&lt;img style="border-width: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart1BuildingtheAdministrationAr_E9F7/Client%20side%20validation_thumb.png" border="0" alt="Client side validation" width="640" height="445" /&gt;&lt;/a&gt; 
&lt;/p&gt;
 
&lt;p&gt;
And server implementation as well
&lt;/p&gt;
 
&lt;p&gt;
&lt;img style="border-width: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlogMvcpart1BuildingtheAdministrationAr_E9F7/serverSide_3.png" border="0" alt="serverSide" width="640" height="445" /&gt; 
&lt;/p&gt;
 
&lt;p&gt;
Moreover, The Helper Class (which acts as the business layer) has some additions in order to add a post to the database.
&lt;/p&gt;
 
&lt;h3&gt;Css and designs&lt;/h3&gt; 
&lt;p&gt;
Css &lt;a href="http://particletree.com/features/rediscovering-the-button-element/" title="http://particletree.com/features/rediscovering-the-button-element/"&gt;http://particletree.com/features/rediscovering-the-button-element/&lt;/a&gt; and &lt;a href="http://wordpress.org"&gt;http://wordpress.org&lt;/a&gt; 
&lt;/p&gt;
 
&lt;p&gt;
Icons &lt;a href="http://www.famfamfam.com/lab/icons/silk/" title="http://www.famfamfam.com/lab/icons/silk/"&gt;http://www.famfamfam.com/lab/icons/silk/&lt;/a&gt;
&lt;/p&gt;
 
&lt;h3&gt;Summary&lt;/h3&gt; 
&lt;p&gt;
And thats all for this part, I have more and more features coming while writing this engine I have learned much till now, hope someone is learning with me too.
&lt;/p&gt;
 
&lt;p&gt;
In this part, I used some features of the ASP.NET MVC to build an administration area, jQuery too was used on client side (validator plugin) so what do you think? you are most welcomed to leave comments.  
&lt;/p&gt;
&lt;p&gt;
Download version one : &lt;a href="http://amrelsehemy.net/file.axd?file=2008%2f9%2fjBlogMvc_version_1.zip"&gt;jBlogMvc_version_1.zip&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
If you liked this blog post then please &lt;strong&gt;&lt;a href="http://feeds.feedburner.com/AmrElsehemyBlog"&gt;subscribe&lt;/a&gt;&lt;/strong&gt; to this blog. 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/sqm9CjOsHD4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/sqm9CjOsHD4/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/09/25/jBlogMvc-part-1-Building-the-Administration-Area.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=e3a88df3-c1c7-4603-ae26-4c1eface6e02</guid>
      <pubDate>Thu, 25 Sep 2008 00:00:00 -0700</pubDate>
      <category>jBlogMvc</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=e3a88df3-c1c7-4603-ae26-4c1eface6e02</pingback:target>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=e3a88df3-c1c7-4603-ae26-4c1eface6e02</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/09/25/jBlogMvc-part-1-Building-the-Administration-Area.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=e3a88df3-c1c7-4603-ae26-4c1eface6e02</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=e3a88df3-c1c7-4603-ae26-4c1eface6e02</feedburner:origLink></item>
    <item>
      <title>Introducing jBlogMvc</title>
      <description>&lt;img style="border: 0px none " src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlog.Mvcpart0Buildingas.NETMVCandjQuery_1E70/ok_3.jpg" border="0" alt="ok" width="282" height="212" align="right" /&gt; 
&lt;p&gt;
Long time no posts, well I was studying Sharepoint 2007 technologies and actually &lt;a href="http://amrelsehemy.net/post/2008/08/06/SP-Dev-part-1-Sharepoint-2007-Development-model-Features.aspx"&gt;started&lt;/a&gt; a &lt;a href="http://amrelsehemy.net/post/2008/08/08/SP-Dev-part-2-Understanding-Sharepoint-Custom-Pages.aspx"&gt;series&lt;/a&gt; for development a while ago I just managed to write two&amp;nbsp; introductory posts and didn&amp;#39;t write more I have some ideas I&amp;#39;d love to share in sharepoint development which I hope to write about them some time in the future and complete the series. However, recently the new ASP.NET MVC framework has gathered some fame and actually I too got attached to it and I am keen to learn new technologies and so, also the &lt;a href="http://jquery.com"&gt;jQuery&lt;/a&gt; javascript library has been the choice of most the .NET web developers community. 
&lt;/p&gt;
&lt;h3&gt;Its Time to Learn&lt;/h3&gt; 
&lt;p&gt;
So, I have read alot of blogs and articles on ASP.NET MVC which has a massive amount of resources (while not being beta yet), I also read the excellent book &amp;quot;jQuery in Action&amp;quot; and learned a lot from it I do recommend it for learning jquery. Now its time to utilize this learning in a simple application that experience the stuff I read about, then I stumbled across this article &lt;a href="http://ifacethoughts.net/2007/09/19/want-to-learn-web-programming-write-a-blog-engine/" title="http://ifacethoughts.net/2007/09/19/want-to-learn-web-programming-write-a-blog-engine/"&gt;Want To Learn Web Programming? Write A Blog Engine&lt;/a&gt; so be it, I will build a (Simple-Fully featured) blog engine in order to learn more and use these two new kids on the block. 
&lt;/p&gt;
&lt;p&gt;
Of course, I will use ASP.NET MVC, jquery and finally I will use Sql Express as the datastore and Linq to Sql for dal.
&lt;/p&gt;
&lt;h3&gt;Where I learn from&lt;/h3&gt; 
&lt;p&gt;
Before starting building my blog series I would like to share the blogs I read to learn from ASP.NET MVC 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;a href="http://blog.wekeroad.com/mvc-storefront/mvc-storefront-part-1/" title="by Rob Conery"&gt;Storefront MVC Series&lt;/a&gt; by Rob Conery.  &lt;/li&gt;
	&lt;li&gt;&lt;a href="http://weblogs.asp.net/stephenwalther/default.aspx"&gt;Stephen Walther&lt;/a&gt; Excellent MVC Tips and Forum series.  &lt;/li&gt;
	&lt;li&gt;Of course &lt;a href="http://weblogs.asp.net/scottgu/archive/tags/MVC/default.aspx"&gt;Scott Gu&amp;#39;s mvc&lt;/a&gt; announcements and demos.  &lt;/li&gt;
	&lt;li&gt;&lt;a href="http://haacked.com/Tags/aspnetmvc/default.aspx"&gt;Phil Haack&lt;/a&gt; blog.  &lt;/li&gt;
	&lt;li&gt;&lt;a href="http://blog.codeville.net/"&gt;Steve Sanderson&lt;/a&gt;  &lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.emadibrahim.com/tag/aspnetmvc/"&gt;Emad Ibrahim&lt;/a&gt; the creator of &lt;a href="http://yonkly.com"&gt;Yonkly&lt;/a&gt; the open source twitter clone built on ASP.NET MVC and jQuery.  &lt;/li&gt;
	&lt;li&gt;&lt;font color="#800080"&gt;&lt;a href="http://blog.eworldui.net/category/MVC.aspx"&gt;Matt Hawley&lt;/a&gt;&lt;/font&gt;  &lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.dotnetkicks.com/tags/ASPNETMVC"&gt;ASP.NET MVC tagged articles on DotNetKicks&lt;/a&gt;  &lt;/li&gt;
	&lt;li&gt;The Official &lt;a href="http://forums.asp.net/1146.aspx"&gt;ASP.NET MVC forums&lt;/a&gt;. &lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Let&amp;#39;s start&lt;/h3&gt; 
&lt;p&gt;
So, what&amp;#39;s &lt;strong&gt;jBlogMvc&lt;/strong&gt;? its a small blogengine I am going to build in an agile process, &lt;strong&gt;jBlogMvc &lt;/strong&gt;if you haven&amp;#39;t notice &lt;strong&gt;j&lt;/strong&gt; stands for jQuery, &lt;strong&gt;Blog&lt;/strong&gt; for the engine itself&amp;nbsp; and &lt;strong&gt;Mvc&lt;/strong&gt; for the ASP.NET MVC. I say here that this engine will be simple and complete I will try to add features as much as possible and build it in an extensible way like modern blog engines to enable themes, widgets and plugins. Also I need to point that the work on this blog engine is totally inspired from the great open source blog engines which include BlogEngine.NET, WordPress and other non blog engines as yonkly and many others. 
&lt;/p&gt;
&lt;h3&gt;What will part 0 cover ?&lt;/h3&gt; 
&lt;p&gt;
Other than announcing the blog engine, in this part I will have a version 0 that will have the following: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Vistor  
	&lt;ul&gt;
		&lt;li&gt;Viewing posts By Chronological order.  &lt;/li&gt;
		&lt;li&gt;Viewing individual posts. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Ok show me some code!&lt;/h3&gt; 
&lt;p&gt;
Too much talking lets get to the code now, ok the solution is as shown in the figure consisting of the following :
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&lt;img style="border: 0px none " src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlog.Mvcpart0Buildingas.NETMVCandjQuery_1E70/solution_3.png" border="0" alt="solution" width="310" height="591" /&gt;
&lt;/p&gt;
&lt;h3&gt;The database &lt;/h3&gt; 
&lt;p&gt;
For this ZERO part I didn&amp;#39;t include much for the blog engine, the only table I included is the Post table as shown below, I do believe this table will be expanded more by time and more parts in the series. 
&lt;/p&gt;
&lt;p&gt;
&lt;img style="border: 0px none " src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/jBlog.Mvcpart0Buildingas.NETMVCandjQuery_1E70/database_3.png" border="0" alt="database" width="444" height="262" /&gt; 
&lt;/p&gt;
&lt;h3&gt;Routes&lt;/h3&gt; 
&lt;div class="code"&gt;&lt;p&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RegisterRoutes(RouteCollection routes)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routes.IgnoreRoute(&amp;quot;{resource}.axd/{*pathInfo}&amp;quot;);  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routes.MapRoute(&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;Posts&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;post/{slug}&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;new&lt;/span&gt; { controller = &amp;quot;Home&amp;quot;, action = &amp;quot;post&amp;quot; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routes.MapRoute(&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;Default&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;{action}/{id}&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;new&lt;/span&gt; { controller = &amp;quot;Home&amp;quot;, action = &amp;quot;Index&amp;quot;, id = &amp;quot;&amp;quot; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&lt;/p&gt;
&lt;/div&gt;&lt;h3&gt;Models&lt;/h3&gt; 
&lt;p&gt;
Just added here a dbml file (Linq to Sql DataContext) , and I added a PostEx.cs file and added a property for the Post, God Bless partial classes. PostEx.cs as shown in Listing 2.
&lt;/p&gt;
&lt;div class="code"&gt;&lt;p&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Post&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; RelativeLink&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; VirtualPathUtility.ToAbsolute(&amp;quot;~/post/&amp;quot;) + Slug;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&lt;/p&gt;
&lt;/div&gt;&lt;h3&gt;Controllers&lt;/h3&gt; 
&lt;p&gt;
For now I only have one controller the HomeController which has simply 3 actions for now.
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;index : Renders a view with all posts sorted in a chronological order  &lt;/li&gt;
	&lt;li&gt;post(slug) : Renders a view for the post with a matching slug if not found it renders error404 view  &lt;/li&gt;
	&lt;li&gt;premalink(guid) : Renders a view for the post with a matching guid if not found it renders error404 view&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
HomeController as shown in Listing 2.
&lt;/p&gt;
&lt;div class="code"&gt;&lt;p&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; HomeController : Controller&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// Renders a view with all posts sorted in a chronological order&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult index()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var posts = Helpers.GetPostList() ?? &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Post&amp;gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(posts);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// Renders a view for the post with a matching slug&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// if not found it renders error404 view&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;slug&amp;quot;&amp;gt;Post slug to be matched&amp;lt;/param&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult post(&lt;span class="kwrd"&gt;string&lt;/span&gt; slug)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var post = Helpers.GetPostBySlug(slug);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; post != &lt;span class="kwrd"&gt;null&lt;/span&gt; ? View(&amp;quot;single&amp;quot;, post) : View(&amp;quot;error404&amp;quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// Renders a view for the post with a matching premalink&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// if not found it renders error404 view&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;id&amp;quot;&amp;gt;Post premalink to be matched&amp;lt;/param&amp;gt;&lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult premalink(Guid id)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var post = Helpers.GetPostByPemalink(id);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; post != &lt;span class="kwrd"&gt;null&lt;/span&gt; ? View(&amp;quot;single&amp;quot;, post) : View(&amp;quot;error404&amp;quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&lt;/p&gt;
&lt;/div&gt;&lt;h3&gt;Views&lt;/h3&gt; 
&lt;p&gt;
The solution now contains one master page for the overall site, three views, and one usercontrol
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;site.Master : gives the overall look and feel for the site  &lt;/li&gt;
	&lt;li&gt;index.aspx : renders all posts.  &lt;/li&gt;
	&lt;li&gt;single.aspx : renders a single post.  &lt;/li&gt;
	&lt;li&gt;error404.aspx : to be rendered when a request to a non matching post slug or premalink  &lt;/li&gt;
	&lt;li&gt;_postView.ascx : the post template to be used&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Utils&lt;/h3&gt; 
&lt;p&gt;
Two classes that help me
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Config: Contains some static properties that read from hard coded strings (in a version coming up should read from the web.config or even a database table).  &lt;/li&gt;
	&lt;li&gt;Helpers: just some common helper methods.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Config File
&lt;/p&gt;
&lt;div class="code"&gt;&lt;p&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Config&lt;br /&gt;
&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; BlogName { get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &amp;quot;My Blog Name&amp;quot;; } }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; BlogDescription { get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &amp;quot;This blog &lt;span class="kwrd"&gt;is&lt;/span&gt; built &lt;span class="kwrd"&gt;using&lt;/span&gt; the ASP.NET MVC framework.&amp;quot;; } }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; BlogUrl { get { &lt;span class="kwrd"&gt;return&lt;/span&gt; VirtualPathUtility.ToAbsolute(&amp;quot;~/&amp;quot;); } }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Version { get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &amp;quot;0.1.0.0&amp;quot;; } }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; } 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt; 
&lt;p&gt;
In this part, I just announced jBlogMvc the ASP.NET MVC and jQuery blogengine which I build in order to learn more about the two new technologies (at least for me), so what do you think? you are most welcomed to leave comments.
&lt;/p&gt;
&lt;p&gt;
Download version zero : &lt;a href="http://amrelsehemy.net/file.axd?file=2008%2f9%2fjBlogMvc_version_0.zip"&gt;jBlogMvc_version_0.zip (624.80 kb)&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
If you liked this blog post then please &lt;strong&gt;&lt;a href="http://feeds.feedburner.com/AmrElsehemyBlog"&gt;subscribe&lt;/a&gt;&lt;/strong&gt; to this blog.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/aLjDoIMz5j8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/aLjDoIMz5j8/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/09/21/Introducing-jBlogMvc.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=0e25e4c3-d724-4058-82b3-c58f63eae6a2</guid>
      <pubDate>Sun, 21 Sep 2008 00:03:00 -0700</pubDate>
      <category>jBlogMvc</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=0e25e4c3-d724-4058-82b3-c58f63eae6a2</pingback:target>
      <slash:comments>17</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=0e25e4c3-d724-4058-82b3-c58f63eae6a2</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/09/21/Introducing-jBlogMvc.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=0e25e4c3-d724-4058-82b3-c58f63eae6a2</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=0e25e4c3-d724-4058-82b3-c58f63eae6a2</feedburner:origLink></item>
    <item>
      <title>SP Dev part 2 : Understanding Sharepoint Custom Pages</title>
      <description>&lt;blockquote&gt;
	 
	&lt;p&gt;
	&lt;em&gt;&lt;strong&gt;NOTE: &lt;/strong&gt;If you haven&amp;#39;t read the &lt;/em&gt;&lt;em&gt;&lt;a href="http://www.amrelsehemy.net/post/2008/08/05/SP-Dev-part-1-Sharepoint-2007-Development-model-Features.aspx"&gt;first post in this series, I would encourage you do to that first&lt;/a&gt;&lt;/em&gt;&lt;em&gt;, or check out &lt;/em&gt;&lt;em&gt;&lt;a href="http://amrelsehemy.net/category/Sharepoint.aspx"&gt;the Sharepoint category&lt;/a&gt;&lt;/em&gt;&lt;em&gt;. You can also always &lt;a href="http://feeds.feedburner.com/AmrElsehemyBlog"&gt;subscribe to the feeds&lt;/a&gt;.&lt;/em&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
 
&lt;p&gt;
The Sharepoint 2007 System introduces two types of pages the first type usually called &lt;strong&gt;Application Pages&lt;/strong&gt; and other type called &lt;strong&gt;Site Pages.&lt;/strong&gt; 
&lt;/p&gt;
 
&lt;p&gt;
As a sharepoint developer you should know both of these types of pages and when to use them, so let me define them here briefly and show some differences between them to help you decide which type of pages you will want to use when developing in sharepoint. 
&lt;/p&gt;
 
&lt;h1&gt;Application Pages&lt;/h1&gt; 
&lt;p&gt;
Application Pages are non customizable and are found in&amp;nbsp; the &lt;strong&gt;&lt;em&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS, &lt;/em&gt;&lt;/strong&gt;its worthy to note that this physical directory is mapped to the virtual &lt;strong&gt;&lt;em&gt;_layouts&lt;/em&gt;&lt;/strong&gt; directory whenever WSS/MOSS creates a new Web application in the IIS. By using this mapping scheme along with some additional processing logic, the WSS/MOSS runtime can make each application page accessible within the context of any site in the farm. 
&lt;/p&gt;
 
&lt;p&gt;
When building custom application pages you should use the &lt;strong&gt;Microsoft.Sharepoint.LayoutsPageBase&lt;/strong&gt; as a base class and should be content pages that reference to the &lt;strong&gt;~/_layouts/application.master&lt;/strong&gt; master page, Application Pages might include in line code or have a code behind file compiled in a dll, to deploy application pages they should be the LAYOUTS directory and all custom code dlls either in the GAC.
&lt;/p&gt;
 
&lt;p&gt;
&lt;a href="http://amrelsehemy.net/image.axd?picture=2008%2f8%2fappPages.jpg"&gt;&lt;img src="http://amrelsehemy.net/image.axd?picture=2008%2f8%2fappPages.jpg" border="0" alt="Standard Application Pages in the WSS" width="640" height="371" /&gt;&lt;/a&gt; 
&lt;/p&gt;
 
&lt;h1&gt;Site Pages (Content Pages)&lt;/h1&gt; 
&lt;p&gt;
Site Pages can be customized on a site-by-site basis. default.aspx page in the Blank site is considered a site page as well as the AllItems.aspx used in lists. When customizing site pages this might lead to hundreds of versions of one site pages, site pages have only one physical version and all customized pages reside in the Content Database of the Web Application. This leads us to one important optimization point known as &lt;em&gt;&lt;strong&gt;page ghosting&lt;/strong&gt;&lt;/em&gt;, imagine that you have just created 100 new WSS sites from the Blank Site template. If none of these sites requires a customized version of its home page (default.aspx), would it still make sense to copy the exact same page definition file into the content database 100 times? Ofcourse not, rather than copying 100 version of the same page in the content database, the WSS runtime can load the page template from the file system of the Web server and use it to process any request for an uncustomized page instance. Therefore, you can say that page ghosting describes the act of processing a request for an uncustomized page instance by using a page template loaded into memory from the file system of the front-end Web server. 
&lt;/p&gt;
 
&lt;p&gt;
&lt;u&gt;Security consideration :&lt;/u&gt; Since the site page can be customized for every customized version, a copy must be stored in the content database, which in turn raises a security issue what if a user having an administrator permission and tries to write in line code within a customized version. This security concern is dealt in WSS by having a default policy that prohibits in line scripting in site pages. The default policy also runs site pages in a no-compile mode, which means they are not compiled into DLLs. 
&lt;/p&gt;
 
&lt;h1&gt;&amp;nbsp;&lt;/h1&gt; 
&lt;h1&gt;Conclusion&lt;/h1&gt; 
&lt;p&gt;
In this part I just scratched the 2 types of pages used in the Sharepoint System I have to say that there is more and more to talk about on this topic which I will write more through this series. 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/9RT0IftGSMM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/9RT0IftGSMM/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/08/08/SP-Dev-part-2-Understanding-Sharepoint-Custom-Pages.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=0dda8481-6133-4c42-9fd9-c18bc553432f</guid>
      <pubDate>Fri, 08 Aug 2008 18:44:00 -0700</pubDate>
      <category>Sharepoint</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=0dda8481-6133-4c42-9fd9-c18bc553432f</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=0dda8481-6133-4c42-9fd9-c18bc553432f</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/08/08/SP-Dev-part-2-Understanding-Sharepoint-Custom-Pages.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=0dda8481-6133-4c42-9fd9-c18bc553432f</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=0dda8481-6133-4c42-9fd9-c18bc553432f</feedburner:origLink></item>
    <item>
      <title>SP Dev part 1 : Sharepoint 2007 Development model {Features}</title>
      <description>&lt;p&gt;
&lt;img style="border-width: 0px" src="/admin/Pages/image.axd?picture=2008/8/s12_3.png" border="0" alt="Sharepoint" title="Sharepoint" width="343" height="200" align="right" /&gt; A new feature in the Sharepoint 2007 is the &amp;quot;&lt;strong&gt;Feature&lt;/strong&gt;&amp;quot; development style which means that every tiny and huge development task in the sharepoint is considered a &amp;quot;&lt;strong&gt;Feature&lt;/strong&gt;&amp;quot;.
&lt;/p&gt;
&lt;p&gt;
Features can be activated or deactivated through a site administrator, which enables the very simple turn on/off of anything in the site.
&lt;/p&gt;
&lt;p&gt;
Features are used for developing anything starting from a small button to a full site definition and tons of files and functions including webparts, workflows, lists, pages, content types, document libraries and others. I will try to include the development of all these topics in this series wish me luck and provide feedback. 
&lt;/p&gt;
&lt;p&gt;
For a start I will show here in this part how to get started with the feature development and the basic elements and files needed for a developing and deploying a sharepoint feature.
&lt;/p&gt;
&lt;p&gt;
Before opening the Visual Studio and starting to code, knowing what the files and where will they be deployed on the server will be mandatory. A very basic feature will include 2 xml files one named &lt;strong&gt;&lt;em&gt;feature.xml&lt;/em&gt;&lt;/strong&gt; and the other will hold the elements of this feature usually named &lt;em&gt;&lt;strong&gt;elements.xml&lt;/strong&gt;&lt;/em&gt; or &lt;em&gt;&lt;strong&gt;elementsManifest.xml&lt;/strong&gt;&lt;/em&gt;, consider that the files for any feature must be deployed in their own special directory inside the WSS system directory named FEATURES. The FEATURES directory is located inside another WSS system directory named TEMPLATE.
&lt;/p&gt;
&lt;pre&gt;
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES
&lt;/pre&gt;
&lt;p&gt;
In our Hello sharepoint feature we will make a very basic feature named HelloSharepoint that when activated will add menu item in the SiteActions menu that will redirect to google.
&lt;/p&gt;
&lt;h1&gt;Feature.xml&lt;/h1&gt;
&lt;pre class="code"&gt;
&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Feature
&lt;/span&gt;&lt;span style="color: red"&gt;Id&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;{INSERT-GUID-HERE}&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Title&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Hello Sharepoint Feature&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Description&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;This is a custom feature which adds a custom item to link to google&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Scope&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Web&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Hidden&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;FALSE&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;ImageUrl&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;google.gif&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ElementManifests&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ElementManifest &lt;/span&gt;&lt;span style="color: red"&gt;Location&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ElementsManifest.xml&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ElementManifests&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Feature&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
As shown above the feature.xml looks very simple, only &lt;strong&gt;Id&lt;/strong&gt; and &lt;strong&gt;Scope&lt;/strong&gt; are the two required attributes and all the others are optional and a full list can be found &lt;a href="http://msdn.microsoft.com/en-us/library/ms436075.aspx"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;h1&gt;ElementsManifest.xml&lt;/h1&gt;
&lt;pre class="code"&gt;
&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;CustomAction
&lt;/span&gt;&lt;span style="color: red"&gt;Id&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;SiteActionsToolbar&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;GroupId&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;SiteActions&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Location&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Microsoft.SharePoint.StandardMenu&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Title&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Hello Sharepoint&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Sequence&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;100&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Description&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;A custom menu item links to google&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;ImageUrl&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;_layouts/images/google.gif&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;UrlAction &lt;/span&gt;&lt;span style="color: red"&gt;Url&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://www.google.com&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;CustomAction&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
And the elementsManifest.xml here describes the elements to be installed with the feature and we only define one element (a CustomAction) you find a bunch of types of elements to be added &lt;a href="http://msdn.microsoft.com/en-us/library/ms474383.aspx"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
That&amp;#39;s all we are done with building our very first feature inside the WSS/MOSS world, I know some of the attributes here seem vague and other seem simple anyway I will try to put a part or two for only discussing these files with their various options.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;h1&gt;Deploying the feature&lt;/h1&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Copying the feature files (feature.xml and elementsManifest.xml) in the Features server path &lt;br /&gt;
	C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES , and the google.gif in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\images 
	&lt;/li&gt;
	&lt;li&gt;Running STSADM.EXE operation to install the feature with WSS/MOSS &lt;em&gt;&lt;strong&gt;&amp;quot;stsadm -o InstallFeature -filename HelloSharepoint\feature.xml -force&amp;quot;&lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;Restarting IIS 
	&lt;/li&gt;
	&lt;li&gt;Finally, activating the features within the site administration&lt;/li&gt;
&lt;/ol&gt;
&lt;img src="http://amrelsehemy.net/image.axd?picture=2008%2f8%2fcustomAction.png" alt="" /&gt;&lt;br /&gt;
&lt;p&gt;
&lt;a href="http://amrelsehemy.net/file.axd?file=2008%2f8%2fSPpart1.zip"&gt;SPpart1.zip (6.74 kb)&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/MjuLbMoU9oA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/MjuLbMoU9oA/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/08/06/SP-Dev-part-1-Sharepoint-2007-Development-model-Features.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=ad10ffda-7312-4c35-8e78-81b4cad20308</guid>
      <pubDate>Wed, 06 Aug 2008 06:55:00 -0700</pubDate>
      <category>Sharepoint</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=ad10ffda-7312-4c35-8e78-81b4cad20308</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=ad10ffda-7312-4c35-8e78-81b4cad20308</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/08/06/SP-Dev-part-1-Sharepoint-2007-Development-model-Features.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=ad10ffda-7312-4c35-8e78-81b4cad20308</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=ad10ffda-7312-4c35-8e78-81b4cad20308</feedburner:origLink></item>
    <item>
      <title>Upgraded to BlogEngine 1.4.5</title>
      <description>&lt;img src="http://amrelsehemy.net/image.axd?picture=2008%2f8%2fworking.jpg" alt="" align="right" /&gt;
&lt;p&gt;
Finally working with fully featured &lt;a href="http://amrelsehemy.net/admin/Pages/www.dotnetblogengine.net"&gt;BlogEngine &lt;/a&gt;on &lt;a href="http://amrelsehemy.net/admin/Pages/www.godaddy.com"&gt;godaddy &lt;/a&gt;the BlogEngine v 1.4.5 has been released and I had the time to update my blog, and finally works as a charm with godaddy shared hosting.
&lt;/p&gt;
&lt;p&gt;
Some features that didn&amp;#39;t work with the 1.4 version was the whole new widget system, Profiles and anything that used the BinaryFormatter at the end, which needed a high or full trust while godaddy shared hosting only allows meduim trust.
&lt;/p&gt;
&lt;p&gt;
In version 1.4.5 &lt;a href="http://blog.madskristensen.dk/"&gt;Mads &lt;/a&gt;and the team removed all the BinaryFormatters references and used normal xml serializers save the widget and extension settings.
&lt;/p&gt;
&lt;p&gt;
For all blogengine users using shared hosting, go ahead v 1.4.5 works out of the box, and also check the &lt;a href="http://blog.madskristensen.dk/post/New-BlogEngineNET-release-coming-up.aspx"&gt;new features released in the latest version. &lt;/a&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/w2BiOz7KJdY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/w2BiOz7KJdY/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/07/31/Upgraded-to-BlogEngine-1-4-5.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=8adb44f9-21a9-44f1-abc0-68643a7560b9</guid>
      <pubDate>Thu, 31 Jul 2008 16:00:00 -0700</pubDate>
      <category>BlogEngine.NET</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=8adb44f9-21a9-44f1-abc0-68643a7560b9</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=8adb44f9-21a9-44f1-abc0-68643a7560b9</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/07/31/Upgraded-to-BlogEngine-1-4-5.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=8adb44f9-21a9-44f1-abc0-68643a7560b9</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=8adb44f9-21a9-44f1-abc0-68643a7560b9</feedburner:origLink></item>
    <item>
      <title>Beginning Sharepoint 2007 Development</title>
      <description>&lt;img src="http://amrelsehemy.net/image.axd?picture=1-t1.gif" alt="" align="right" /&gt;
&lt;p&gt;
I mentioned a long while ago that I will work on some sharepoint and workflow foundation in order to enlarge my development knowledge base, I learned some stuff on the way may be all sharepoint and workflows beginners already know them but I love to share them for others.
&lt;/p&gt;
&lt;p&gt;
I will start another series for sharepoint development (for beginners as myself) so If anyone out there finds out a better approach for anything I write or correction welcome for commenting on the posts so all can benefit too. 
&lt;/p&gt;
&lt;p&gt;
This series will start with introductory posts that are needed to understand the architecture and object model of sharepoint, these introduction points are all over the web and blogs of sharepoint pros, I will write them again in my wa, then proceed with some basic development then advanced, I don&amp;#39;t have an outline for the posts I am gonna write I have some ideas any reader is welcome to add in comments any topic related to sharepoint development wants me to write about, hoping this series be useful like my older one Design Time Support of Custom Controls, so wish me luck. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/FgMVgAwrMT8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/FgMVgAwrMT8/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/07/28/Beginning-Sharepoint-2007-Development.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=f43fcf94-92a2-462a-8854-7cb9bd5bf886</guid>
      <pubDate>Mon, 28 Jul 2008 04:33:00 -0700</pubDate>
      <category>Sharepoint</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=f43fcf94-92a2-462a-8854-7cb9bd5bf886</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=f43fcf94-92a2-462a-8854-7cb9bd5bf886</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/07/28/Beginning-Sharepoint-2007-Development.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=f43fcf94-92a2-462a-8854-7cb9bd5bf886</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=f43fcf94-92a2-462a-8854-7cb9bd5bf886</feedburner:origLink></item>
    <item>
      <title>Have been tagged</title>
      <description>&lt;p&gt;This blog has been idle for some while, I was very busy,&amp;nbsp;out of mood, studying for my masters and reading new technologies (for me like workflow and sharepoint development and some WCF). I didn&amp;#39;t know what time my blogging mood will be back, until my friend &lt;a rel="friend" href="http://mosesofegypt.net/"&gt;Moses&lt;/a&gt; insisted to get me back and &lt;a href="http://mosesofegypt.net/post/2008/07/12/How-I-got-started-in-software-development!.aspx"&gt;tagged me &lt;/a&gt;in the &lt;strong&gt;&lt;em&gt;how I got started in software development&lt;/em&gt;&lt;/strong&gt;, that started a while ago by &lt;a rel="contact" href="http://www.michaeleatonconsulting.com/blog/"&gt;Michel Eaton&lt;/a&gt;. So here we go. &lt;/p&gt;&lt;strong&gt;How old were you when you started programming?&lt;/strong&gt;&lt;img src="http://amrelsehemy.net/image.axd?picture=stars.png" alt="" width="190" height="185" align="right" /&gt; &lt;p&gt;10 years old (12 years ago). &lt;/p&gt;&lt;strong&gt;How did you get started in programming?&lt;/strong&gt; &lt;p&gt;My father used to make simple programs using C that showed dots and stuff I dont get till now &lt;img src="/editors/tiny_mce/plugins/emotions/images/smiley-smile.gif" border="0" alt="Smile" title="Smile" width="18" height="18" /&gt;, he used to let me write for him some code. Few years more my sister joined computer science and had assignments to program C++ application thats when I really got involved and started to read.(16 years old) &lt;/p&gt;&lt;strong&gt;What was your first language?&lt;/strong&gt; &lt;p&gt;By that time it was C.&amp;nbsp; &lt;/p&gt;&lt;strong&gt;What was the first real program you wrote?&lt;/strong&gt;&amp;nbsp; &lt;p&gt;My very first own program I wrote was the famous star pyramid using C++, My first windows application and favourite is the &lt;a href="http://en.wikipedia.org/wiki/Minesweeper_(computer_game)" title="MineSweeper on Wikipedia"&gt;MineSweeper&lt;/a&gt;, which is my helloworld application that I used for many languages, I used to have the following minesweeper versions (WinForms, WPF, Assembly, Silverlight, OpenGL, DirectX, javascript). &lt;/p&gt;&lt;strong&gt;What languages have you used since you started programming?&lt;/strong&gt; &lt;p&gt;C, C++, VisualBasic.Net, C#, Java, Assembly, Prolog, Javascript, HTML/XHTML, XAML&amp;nbsp;and lot of other technologies related to development not considered programming language. &lt;/p&gt;&lt;strong&gt;What was your first professional programming gig?&lt;/strong&gt; &lt;p&gt;Was&amp;nbsp;4 years ago, I used C# for building winforms applications&amp;nbsp;connecting to databases in my summer training that time. &lt;/p&gt;&lt;strong&gt;If you knew then what you know now, would you have started programming?&lt;/strong&gt;&amp;nbsp; &lt;img src="http://amrelsehemy.net/image.axd?picture=programmerit5.jpg" alt="" width="390" height="325" align="right" /&gt; &lt;p&gt;OfCourse. I code with passion, love blogging and exploring new technologies around the block. I could have never imagined myself anything other than what am I in now. &lt;/p&gt;&lt;strong&gt;What is the one thing you would tell new developers?&lt;/strong&gt; &lt;p&gt;Code for fun not for money. Have a life. Don&amp;#39;t forget to lie to girls &amp;amp;&amp;nbsp; Buy&amp;nbsp;your RayBan as &lt;a href="http://blog.madskristensen.dk/post/From-wine-to-web.aspx"&gt;Mads&lt;/a&gt; said I already got mine&lt;img src="/editors/tiny_mce/plugins/emotions/images/smiley-cool.gif" border="0" alt="Cool" title="Cool" width="18" height="18" /&gt; thank you Mads. &lt;/p&gt;&lt;strong&gt;What&amp;#39;s the most fun you&amp;#39;ve ever had ... programming?&lt;/strong&gt; &lt;p&gt;Building my very first Minesweeper&amp;nbsp;and talking about it to my very&amp;nbsp;best friend that time. &lt;/p&gt;&lt;strong&gt;Now what ..?&lt;/strong&gt; &lt;p&gt;First, I&amp;#39;d like to thank my friend Moses&amp;nbsp;for not only tagging me but for making me get back to the blogging mood, I hope to continue blogging regularly like old days. &lt;/p&gt;&lt;p&gt;Second, I&amp;#39;d like to pass this to my favourite bloggers, most of them already have been tagged, I recommend you reading them too, &lt;a href="http://encosia.com/2008/07/01/how-i-got-started-in-software-development/"&gt;Dave&lt;/a&gt;, &lt;a href="http://www.mattberseth.com/blog/2008/07/how_i_got_started_in_programmi.html"&gt;Matt&lt;/a&gt;, &lt;a href="http://blog.madskristensen.dk/post/From-wine-to-web.aspx"&gt;Mads&lt;/a&gt;, &lt;a href="http://mosesofegypt.net/post/2008/07/12/How-I-got-started-in-software-development!.aspx"&gt;Moses&lt;/a&gt;, &lt;a href="http://www.misfitgeek.com/How+I+Got+Started+In+Programming.aspx"&gt;Joe&lt;/a&gt;&amp;nbsp;and &lt;a href="http://nayyeri.net/blog/how-i-got-started-in-software-development/"&gt;Keyvan&lt;/a&gt;. And now I tag &lt;a href="http://blogs.msdn.com/bashmohandes/"&gt;Bashmohandes&lt;/a&gt; to write his story. &lt;/p&gt;&lt;p&gt;Anyone reading this and wants to write about his story just head straight to &lt;a href="http://www.michaeleatonconsulting.com/blog/archive/2008/06/04/how-did-you-get-started-in-software-development.aspx"&gt;Michel&amp;#39;s post &lt;/a&gt;and write him a comment. &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/IeHGpJaszxM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/IeHGpJaszxM/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/07/13/how-i-got-started-in-software-development.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=b9fa7731-afe2-456f-8d95-d40ffa6361b2</guid>
      <pubDate>Sun, 13 Jul 2008 11:14:00 -0700</pubDate>
      <category>My Site</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=b9fa7731-afe2-456f-8d95-d40ffa6361b2</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=b9fa7731-afe2-456f-8d95-d40ffa6361b2</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/07/13/how-i-got-started-in-software-development.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=b9fa7731-afe2-456f-8d95-d40ffa6361b2</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=b9fa7731-afe2-456f-8d95-d40ffa6361b2</feedburner:origLink></item>
    <item>
      <title>Moving to Sharepoint and Workflow</title>
      <description>&lt;p&gt;
My blog has been quiet for a long time now, I had a crowded month I didn&amp;#39;t get the time to write anything but I am back to writing I hope so.
&lt;/p&gt;
&lt;p&gt;
Last month I had some working tasks on new technologies (for me) , a new course to study for and of course all my PreMasters studies in my university.
&lt;/p&gt;
&lt;p&gt;
So, I think my focus next blog post will be on the new stuff I learned about Sharepoint 2007 and workflow foundation hope I can write something useful.
&lt;/p&gt;
&lt;p&gt;
By the way I have just&amp;nbsp;passed&amp;nbsp;the &lt;em&gt;70-631 Exam TS: Configuring Windows SharePoint Services 3.0. &lt;/em&gt;So I have a new MCTS in my transcript.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/ojlp01uzjkA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/ojlp01uzjkA/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/04/20/Moving-to-Sharepoint-and-Workflow.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=ab6a7b15-eda9-4688-baf0-98487bd2fa3a</guid>
      <pubDate>Sun, 20 Apr 2008 02:09:00 -0700</pubDate>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=ab6a7b15-eda9-4688-baf0-98487bd2fa3a</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=ab6a7b15-eda9-4688-baf0-98487bd2fa3a</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/04/20/Moving-to-Sharepoint-and-Workflow.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=ab6a7b15-eda9-4688-baf0-98487bd2fa3a</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=ab6a7b15-eda9-4688-baf0-98487bd2fa3a</feedburner:origLink></item>
    <item>
      <title>Yet another BlogEngine.NET feature that I love</title>
      <description>&lt;p&gt;
A while ago, &lt;a rel="contact" href="http://www.razorant.com/blog/"&gt;Al Nyveldt&lt;/a&gt; wrote a post on &lt;a href="http://razorant.com/blog/post/5-Things-I-Love-about-BlogEngineNET.aspx"&gt;5 things he loves about BlogEngine.Net&lt;/a&gt;&amp;nbsp; and I totally agree with him on all the 5 and more coming in the future releases,&amp;nbsp; &lt;a rel="contact" href="http://blog.madskristensen.dk/"&gt;Mads Kristensen&lt;/a&gt; too wrote and made &lt;a href="http://blog.madskristensen.dk/post/Video-widget-framework.aspx"&gt;a video on a the widget framework&lt;/a&gt; on a nice feature coming up in the next version of &lt;a href="http://www.dotnetblogengine.net"&gt;blogengine.net&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
BlogEngine.Net is built to take advantage of standards, one standard I loved that is implemented in BlogEngine is the &lt;a href="http://www.opensearch.org/Home"&gt;OpenSearch&lt;/a&gt;&amp;nbsp;&lt;br /&gt;
standard. 
&lt;/p&gt;
&lt;p&gt;
The cool thing about this standard is that modern browsers are able to detect it and have the option to add the search through the blog. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/YetanotherBlogEngine.NETfeaturethatIlove_14F6B/ie_2.png"&gt;&lt;img style="border-width: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/YetanotherBlogEngine.NETfeaturethatIlove_14F6B/ie_thumb.png" border="0" alt="Internet explorer 7" width="244" height="243" /&gt;&lt;/a&gt;&amp;nbsp; &lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/YetanotherBlogEngine.NETfeaturethatIlove_14F6B/ff_2.png"&gt;&lt;img style="border-width: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/YetanotherBlogEngine.NETfeaturethatIlove_14F6B/ff_thumb.png" border="0" alt="firefox 2" width="244" height="202" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
The opensearch standard is an xml document written in a &lt;a href="http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_elements"&gt;special format&lt;/a&gt; you can see &lt;a href="http://amrelsehemy.net/opensearch.axd"&gt;mine here&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
And when I search through the browser I am sent to this : 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/YetanotherBlogEngine.NETfeaturethatIlove_14F6B/search_2.png"&gt;&lt;img style="border: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/YetanotherBlogEngine.NETfeaturethatIlove_14F6B/search_thumb.png" border="0" alt="search" width="244" height="193" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
So to implement opensearch in your site, (should have something to search in) you need to do these 2 steps. 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Build an opensearch format xml file. &lt;/li&gt;
	&lt;li&gt;Attach the file from your homepage using the appropriate tag in the head section, like the following. &lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="code"&gt;
&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;link &lt;/span&gt;&lt;span style="color: red"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Amr Elsehemy&amp;#39;s Weblog&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;application/opensearchdescription+xml&amp;quot; 
&lt;/span&gt;&lt;span style="color: red"&gt;href&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://www.amrelsehemy/opensearch.axd&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;rel&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;search&amp;quot;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
Thats All. 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/YSe1i3aNQe4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/YSe1i3aNQe4/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/03/25/Yet-another-BlogEngineNET-feature-that-I-love.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=ef7b2d58-b384-4a4a-a8d4-f3fbedf50b63</guid>
      <pubDate>Tue, 25 Mar 2008 15:04:00 -0700</pubDate>
      <category>BlogEngine.NET</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=ef7b2d58-b384-4a4a-a8d4-f3fbedf50b63</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=ef7b2d58-b384-4a4a-a8d4-f3fbedf50b63</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/03/25/Yet-another-BlogEngineNET-feature-that-I-love.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=ef7b2d58-b384-4a4a-a8d4-f3fbedf50b63</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=ef7b2d58-b384-4a4a-a8d4-f3fbedf50b63</feedburner:origLink></item>
    <item>
      <title>ASP.NET Security : 2- More Basics</title>
      <description>&lt;p&gt;
In my &lt;a href="http://amrelsehemy.net/post/2008/03/ASPNET-Security--1--Basics.aspx"&gt;previous post&lt;/a&gt; I showed that ASP.NET application goes through 3 security context levels and discussed the first one :
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;IIS Level &lt;/li&gt;
	&lt;li&gt;ASP.NET worker process level &lt;/li&gt;
	&lt;li&gt;ASP.NET pipeline level &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
In this post, I will talk a little on ASP.NET worker process level, before starting I would like to point out the development environment we use, the development machines run windows XP and IIS 5.1, the server runs windows server 2003 on IIS 6 of course, so I need to point out the differences. 
&lt;/p&gt;
&lt;p&gt;
2- The &lt;strong&gt;Worker Process Context&lt;/strong&gt; : 
&lt;/p&gt;
&lt;h6&gt;&lt;u&gt;IIS 5&lt;/u&gt; &lt;br /&gt;
&lt;/h6&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	After &lt;a href="http://amrelsehemy.net/post/2008/03/ASPNET-Security--1--Basics.aspx"&gt;IIS authentication&lt;/a&gt;, if the request is for ASP.NET (.aspx, .ashx, ....etc. ) the IIS thread sends the request to &lt;strong&gt;&lt;em&gt;aspnet_isapi.dll&lt;/em&gt;&lt;/strong&gt; which starts the &lt;strong&gt;&lt;em&gt;aspnet_wp&lt;/em&gt;&lt;/strong&gt; worker process. This worker process runs under the ASPNET account. &lt;em&gt;ASPNET account is a local account created when the .NET Framework is installed.&lt;/em&gt; ASPNET has minimum privileges to be able to run an ASP.NET application which you can know in this article : &lt;br /&gt;
	&lt;em&gt;from &lt;/em&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/3648346f-e4f5-474b-86c7-5a86e85fa1ff.mspx?mfr=true" title="http://www.microsoft.com/technet.....mspx"&gt;&lt;em&gt;http://www.microsoft.com/technet.....mspx&lt;/em&gt;&lt;/a&gt; &lt;br /&gt;
	You can change the identity from ASPNET to other one using the section in machine.config
	&lt;/p&gt;
	&lt;pre class="code"&gt;
	&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;processModel &lt;/span&gt;&lt;span style="color: red"&gt;userName&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;xxx&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;password&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;XXX&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;
	&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;h6&gt;&lt;u&gt;IIS 6&lt;/u&gt;&lt;/h6&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	In IIS 6, the model is changed where the incoming request in first queued to the application pool that the website is hosted in, then the &lt;strong&gt;&lt;em&gt;w3wp.exe&lt;/em&gt;&lt;/strong&gt; worker process servers it. &lt;br /&gt;
	This time rather than the ASPNET account a new one was introduced named NETWORK SERVICE with the same minimum privileges. To change the this account from the IIS manager, the Application Pool properties &amp;gt; Identity Tab as shown in figure, Read &lt;a href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/webapp/iis/iis6perf.mspx"&gt;More on Application Pools&lt;/a&gt;.
	&lt;/p&gt;
	&lt;p&gt;
	&lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/ASP.NETSecurity2MoreBasics_BFE3/iis%20pool%20identity_5.gif"&gt;&lt;img style="border: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/ASP.NETSecurity2MoreBasics_BFE3/iis%20pool%20identity_thumb_1.gif" border="0" alt="iis pool identity" width="244" height="230" /&gt;&lt;/a&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Next in the worker process, one of the pooled threads picks the request. This thread will by default inherit the identity of the worker process itself defined before, this happens when impersonation is disabled, while if it is enabled the thread will take the identity handed by the IIS, shown in the previous post.
&lt;/p&gt;
&lt;p&gt;
To enable impersonation use this section in web.config
&lt;/p&gt;
&lt;pre class="code"&gt;
&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;identity &lt;/span&gt;&lt;span style="color: red"&gt;impersonate&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;true&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;
read more about it on &lt;a href="http://support.microsoft.com/kb/306158"&gt;How to implement impersonation in an ASP.NET application&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Note: If the impersonation is enabled, the worker process account doesn&amp;#39;t change, but impersonation is only used with the code executed in the page, where any database access or file access uses the impersonated account.
&lt;/p&gt;
&lt;p&gt;
Next the last security context level is handled the request and executes, next post I will show preliminary information on the ASP.NET pipeline level. 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/0G0P6L8xlII" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/0G0P6L8xlII/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/03/25/ASPNET-Security-2-More-Basics.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=c8b62c47-d7ab-479c-918c-6e969e792782</guid>
      <pubDate>Tue, 25 Mar 2008 02:32:00 -0700</pubDate>
      <category>Security</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=c8b62c47-d7ab-479c-918c-6e969e792782</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=c8b62c47-d7ab-479c-918c-6e969e792782</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/03/25/ASPNET-Security-2-More-Basics.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=c8b62c47-d7ab-479c-918c-6e969e792782</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=c8b62c47-d7ab-479c-918c-6e969e792782</feedburner:origLink></item>
    <item>
      <title>ASP.NET Security : 1- Basics</title>
      <description>&lt;p&gt;
Lately at &lt;a href="http://www.scs-me.com"&gt;SCS&lt;/a&gt; I have been assigned to build up the security module and related tasks in the &lt;a href="http://www.scs-me.com/dynamic/Products/Maisonette/Default.aspx"&gt;Real Estate Management System&lt;/a&gt; we are building. So I decided to share what I have learned in this past period and of course to hear from the community to find optimal solutions for the scenarios I worked with, all what I write here might be repeated but I will share it anyway.  
&lt;/p&gt;
&lt;p&gt;
In this part, I will show some important basic points that should be clear to everyone before implementing asp.net security tasks. 
&lt;/p&gt;
&lt;p&gt;
Looking at any web application, the security is a matter of users/passwords/roles/groups... etc. While ASP.NET provides more mechanisms for authentication and authorization that work with the Operating system,IIS and .NET framework classes. So the ASP.NET application runs through these 3 levels. 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;IIS Level&lt;/li&gt;
	&lt;li&gt;ASP.NET worker process level&lt;/li&gt;
	&lt;li&gt;ASP.NET pipeline level&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
So, the Big Question, &lt;strong&gt;What is the Identity that runs my application &lt;/strong&gt;? 
&lt;/p&gt;
&lt;p&gt;
First, When an IIS web server machine receives an ASP.NET request, the IIS assigns it to one of the threads pooled in it, IIS runs under the &lt;strong&gt;SYSTEM&lt;/strong&gt; account which has all the powers in a Microsoft Windows operating system. You can read extra information in the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms178473.aspx"&gt;ASP.NET Application Life Cycle Overview&lt;/a&gt; article on the msdn. 
&lt;/p&gt;
&lt;p&gt;
Next, the 3 security levels run on the request one after the other. 
&lt;/p&gt;
&lt;p&gt;
1- The &lt;strong&gt;IIS thread context&lt;/strong&gt; : the identity of this thread is determined according to the settings of the website in the IIS which has one of the following settings: 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;em&gt;&lt;strong&gt;Basic &lt;/strong&gt;authentication prompts the user for a user name and a password, also called credentials, which are sent unencrypted over the network.&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;&lt;strong&gt;Integrated Windows&lt;/strong&gt; authentication uses hashing technology to scramble user names and password before sending them over the network.&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;&lt;strong&gt;Digest&lt;/strong&gt; authentication operates much like Basic authentication, except that passwords are sent across the network as a hash value. Digest authentication is only available on domains with domain controllers running Windows Server operating systems.&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;&lt;strong&gt;Anonymous&lt;/strong&gt; authentication allows everyone access to the public areas of the Web sites, without asking for a user name or password. &lt;/em&gt;When this is set, the identity impersonates the identity set in the textboxes, with the default user name IUSR_&lt;em&gt;MACHINENAME&lt;/em&gt;. Like shown in the figure down below.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Further more, IIS provides SSL (Secure Socket Layer) authentication mode that is based on certificates, to authenticate users requesting/providing secret information on the server, two trusted certificate providers (which I know but never used) are &lt;a href="http://www.thawte.com/" title="http://www.thawte.com/"&gt;http://www.thawte.com/&lt;/a&gt; and &lt;a href="http://www.verisign.com/" title="http://www.verisign.com/"&gt;http://www.verisign.com/&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/ASP.NETSecurity1Basics_1097D/AuthenticationMethods%20IIS%205_2.jpg"&gt;&lt;img style="border: 0px" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/ASP.NETSecurity1Basics_1097D/AuthenticationMethods%20IIS%205_thumb.jpg" border="0" alt="AuthenticationMethods IIS 5" width="404" height="237" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
After authentication, the thread sends the request to the appropriate external module. 
&lt;/p&gt;
&lt;p&gt;
Next part I will talk about the 2 next security level contexts. 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/1Cem8nWloXg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/1Cem8nWloXg/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/03/19/ASPNET-Security-1-Basics.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=47d00c33-ca82-4c37-83ef-834c58e6386f</guid>
      <pubDate>Wed, 19 Mar 2008 09:53:00 -0700</pubDate>
      <category>Security</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=47d00c33-ca82-4c37-83ef-834c58e6386f</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=47d00c33-ca82-4c37-83ef-834c58e6386f</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/03/19/ASPNET-Security-1-Basics.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=47d00c33-ca82-4c37-83ef-834c58e6386f</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=47d00c33-ca82-4c37-83ef-834c58e6386f</feedburner:origLink></item>
    <item>
      <title>Exploring GDI+ : Using the Pen</title>
      <description>&lt;p&gt;In my tour in exploring GDI+ I &lt;a title="Exploring the Brush" href="http://amrelsehemy.net/post/2008/02/Exploring-GDI-plus-Using-The-Brush.aspx"&gt;explored the Brush object&lt;/a&gt;, now its time for some Pen stuff. &lt;/p&gt; &lt;p&gt;While the Brush classes are used to fill shapes, the Pen class is used to frame shapes. However, Pens are not only used for simple frames. Here in this post I show some advanced uses for the Pen. &lt;/p&gt; &lt;p&gt;Some interesting members are : &lt;/p&gt;&lt;pre&gt;sealed class Pen : MarshalByRefObject, ICloneable,  IDisposable 
{  &lt;br&gt;// Constructors  &lt;br&gt;public Pen(Brush brush);  &lt;br&gt;public Pen(Brush brush, float width);  &lt;br&gt;public Pen(Color color);  &lt;br&gt;public Pen(Color color, float width);  &lt;br&gt;// Properties  &lt;br&gt;public Color Color { get; set; }  &lt;br&gt;public CustomLineCap CustomEndCap { get; set; }  &lt;br&gt;public CustomLineCap CustomStartCap { get; set; }  &lt;br&gt;public DashCap DashCap { get; set; }  &lt;br&gt;public float DashOffset { get; set; }  &lt;br&gt;public float[] DashPattern { get; set; }  &lt;br&gt;public DashStyle DashStyle { get; set; }  &lt;br&gt;public LineCap EndCap { get; set; }  &lt;br&gt;public LineJoin LineJoin { get; set; }  &lt;br&gt;public LineCap StartCap { get; set; }  &lt;br&gt;public float Width { get; set; &lt;br&gt;}&lt;/pre&gt;&lt;pre&gt;//Other members removed here.}&lt;/pre&gt;
&lt;p&gt;As you can see, the pen can be instantiated with a Color or with a defined Brush that means the pen can be one of the &lt;a href="http://amrelsehemy.net/post/2008/02/Exploring-GDI-plus-Using-The-Brush.aspx"&gt;Brush Types&lt;/a&gt;I previously wrote about. &lt;/p&gt;
&lt;p&gt;In addition to their brushlike behavior, pens have behavior at starting and ending along their length that brushes don't have. For example, each end can have a different style, as determined by the LineCap enumeration shown next. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Line Caps&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/ExploringGDIUsingthePen_CE5C/1_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="169" alt="1" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/ExploringGDIUsingthePen_CE5C/1_thumb.png" width="260" border="0"&gt;&lt;/a&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can set different LineCaps for pens in the StartCap and EndCap properties of the Pen, there are predefined caps and custom caps are allowed too. &lt;/p&gt;&lt;pre class="code"&gt;        &lt;span style="color: blue"&gt;private void &lt;/span&gt;RenderPens1(&lt;span style="color: #2b91af"&gt;Graphics &lt;/span&gt;g)&lt;br&gt;        {&lt;br&gt;            &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Pen &lt;/span&gt;p = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Pen&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Color&lt;/span&gt;.Black, 10))&lt;br&gt;            {&lt;br&gt;                p.EndCap = &lt;span style="color: #2b91af"&gt;LineCap&lt;/span&gt;.ArrowAnchor;&lt;br&gt;                g.DrawLine(p, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Point&lt;/span&gt;(10, 20), &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Point&lt;/span&gt;(300, 20));&lt;br&gt;&lt;span style="color: green"&gt;//other pens&lt;br&gt;                &lt;/span&gt;p.EndCap = &lt;span style="color: #2b91af"&gt;LineCap&lt;/span&gt;.Custom;&lt;br&gt;                &lt;span style="color: green"&gt;// width and height of 3 and unfilled arrow head&lt;br&gt;                &lt;/span&gt;p.CustomEndCap = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;AdjustableArrowCap&lt;/span&gt;(3, 3, &lt;span style="color: blue"&gt;false&lt;/span&gt;);&lt;br&gt;                g.DrawLine(p, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Point&lt;/span&gt;(10, 260), &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Point&lt;/span&gt;(300, 260));&lt;br&gt;            }&lt;br&gt;        }&amp;nbsp; &lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Dashes&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;In addition to the ends having special styles the starts can have as well, further more a line can have a dash style, as defined by the DashStyle enumeration. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/ExploringGDIUsingthePen_CE5C/2_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="169" alt="Dash Style of Pen" src="http://amrelsehemy.net/image.axd?picture=WindowsLiveWriter/ExploringGDIUsingthePen_CE5C/2_thumb.png" width="260" border="0"&gt;&lt;/a&gt; &lt;/p&gt;&lt;pre class="code"&gt;        &lt;span style="color: blue"&gt;private void &lt;/span&gt;RenderPens2(&lt;span style="color: #2b91af"&gt;Graphics &lt;/span&gt;g)&lt;br&gt;        {&lt;br&gt;            &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Pen &lt;/span&gt;p = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Pen&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Color&lt;/span&gt;.Black, 10))&lt;br&gt;            {
                p.DashStyle = &lt;span style="color: #2b91af"&gt;DashStyle&lt;/span&gt;.Dash;&lt;br&gt;                g.DrawLine(p, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Point&lt;/span&gt;(10, 20), &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Point&lt;/span&gt;(300, 20));&lt;br&gt;&lt;span style="color: green"&gt;//other DashStyles&lt;br&gt;                &lt;/span&gt;p.DashStyle = &lt;span style="color: #2b91af"&gt;DashStyle&lt;/span&gt;.Custom;&lt;br&gt;                p.DashPattern = &lt;span style="color: blue"&gt;new float&lt;/span&gt;[] { 1f, .5f, 2f, .5f, 3f, .5f, 4f };&lt;br&gt;                g.DrawLine(p, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Point&lt;/span&gt;(10, 170), &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Point&lt;/span&gt;(300, 170));
            }
        }&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;As you can notice in the members of the Pen, the DashCap property which also accepts a LineCap enumeration, so you can take more control over the line that appears. &lt;br&gt;Thats all for this part. Happy Coding. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://amrelsehemy.net/file.axd?file=frmPens.cs" rel="enclosure"&gt;PensForm.cs (2.86 kb)&lt;/a&gt; &lt;/p&gt;&lt;pre&gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/AmrElsehemyBlog/~4/4uSX8UQ7O-8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/AmrElsehemyBlog/~3/4uSX8UQ7O-8/post.aspx</link>
      <author>aelsehemy.nospam@nospam.gmail.com (Amr)</author>
      <comments>http://amrelsehemy.net/post/2008/03/15/Exploring-GDI-Using-the-Pen.aspx#comment</comments>
      <guid isPermaLink="false">http://amrelsehemy.net/post.aspx?id=53547a0f-c533-42b5-a7df-d05a95d81a74</guid>
      <pubDate>Sat, 15 Mar 2008 05:11:25 -0700</pubDate>
      <category>GDI+</category>
      <dc:publisher>Amr</dc:publisher>
      <pingback:server>http://amrelsehemy.net/pingback.axd</pingback:server>
      <pingback:target>http://amrelsehemy.net/post.aspx?id=53547a0f-c533-42b5-a7df-d05a95d81a74</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://amrelsehemy.net/trackback.axd?id=53547a0f-c533-42b5-a7df-d05a95d81a74</trackback:ping>
      <wfw:comment>http://amrelsehemy.net/post/2008/03/15/Exploring-GDI-Using-the-Pen.aspx#comment</wfw:comment>
      <wfw:commentRss>http://amrelsehemy.net/syndication.axd?post=53547a0f-c533-42b5-a7df-d05a95d81a74</wfw:commentRss>
    <feedburner:origLink>http://amrelsehemy.net/post.aspx?id=53547a0f-c533-42b5-a7df-d05a95d81a74</feedburner:origLink></item>
  </channel>
</rss>
