Geeks With Blogs
Rajesh Pillai My experiments with asp.net mvc, jquery, wpf, silverlight, sharepoint, tdd and design patterns.

Prototype

This time we will have a basic prototype ready for the public website.  The design will be kept simple so that we
could concentrate on the main task at hand.  Later on we will enable theming,so that the user could customize the
blog to their heart's content.

The landing page looks like in the figure below.


Create a "Blog" folder under the "Views" folder in the website.  Add an aspx and copy the below markup and name it "List.aspx". 

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Eboard.Model.Blog>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    List
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>You have <%= Model.Count() %> blogs created.</h2>
    <table>
        <tr>
            <th></th>
            <th>Title</th>
            <th>Created On</th>
        </tr>

    <% foreach (var item in Model) { %>
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new {  id=item.Id  }) %> |
                <%= Html.ActionLink("Show", "Show", new {  id=item.Id  })%>
            </td>
            <td>
                <%= Html.Encode(item.Title) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.CreatedOn)) %>
            </td>
        </tr>
    <% } %>
    </table>
    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>
</asp:Content>

Create a "BlogController.cs" in the "Controller" folder and copy the following code.

 public ActionResult List()
 {
      ViewData["Message"] = "Welcome to Ebaord.  The minimalistic blogging engine!";
      return View();  // by default this returns a view with the name "List"
 }

The above is just the boiler plate code just for reference.  The actual method will be implemented once we build our
repository and service layer.

When the user click on the "Show" link the user will be taken to the home page of that blog.


The final product may vary a bit as we go along. See you soon.  Happy prototyping....

Posted on Saturday, November 28, 2009 12:25 AM jQuery , asp.net mvc , Application Development | Back to top


Comments on this post: Lets build a simple blog engine - Prototype for Public Site [eboard] - 3

# re: Lets build a simple blog engine - Prototype for Public Site [eboard] - 3
Requesting Gravatar...

Fine information, many thanks to the author. It is puzzling to me now, but in general, the usefulness and significance is overwhelming. Very much thanks again and good luck!
Left by custom screen print on Nov 29, 2009 8:56 AM

Your comment:
 (will show your gravatar)


Copyright © Rajesh Pillai | Powered by: GeeksWithBlogs.net