This project is read-only.

The simplest demo should start with showing “Hello World” on ASP.NET MVC views both on ASPX view engine and new view engine named Razor. This demo will show about main concept of this framework.

1.  Create ASP.NET MVC 3 Web Application

Open Visual Studio 2010 and Click New Project then select ASP.NET MVC 3 Web Application.

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If you successfully install ASP.NET MVC 3 Tool for Visual Studio, it will show project option dialog. You can select Razor view engine that works best when you heavily write a lot of JavaScript direct to view page or select ASPX view engine if you mostly use helper to generate view page.

image

Structure of created project should look like this (if you select Razor view engine).

image

2. Import Higgs library and other required DLL.

Currently, Higgs does not add package library reference via NuGet Package Manager (It will be supported later). Next, Add reference to required assemblies like the following picture.

image

You may consider to add all reference assemblies to current solution for easy to management when adding solution to source code or share assemblies across project.

image

 

Note. You can download latest assemblies for the following links.

Higgs RIA Framework : https://higgs.svn.codeplex.com/svn/Higgs/Main%20Library/

3rd Parties Assemblies : https://higgs.svn.codeplex.com/svn/Higgs/Common/

3. Add reference to required .NET library and update current web.config file

Add reference to System.Data.Entity assembly and add below XML into current web.config file.

<configuration>
  <
system.web
>
    <
assemblies
>
      <
add assembly="System.Data.Entity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
    </
assemblies
>
  </
system.web
>
</
configuration
>

Finally, the project should look like this.

image

4. Create Home controller and View that corresponds to Home controller

Create the following source code as HomeController.cs under Controllers folder.

using System.Web.Mvc;

namespace Basic.HelloWorld.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    }
}

Next, create view under Views/Home directory.

Razor view engine

@using Higgs.Web.Controls
@{
    Layout = null;
}

@(  Html.CreateButton()
        .SetText("Click Me")
        .OnClick("alert('Hello World!');")
)

ASPX view engine

<%= Html.CreateButton()
        .SetText("Click Me")
        .OnClick("alert('Hello World!');")
%>

5. See the result

 clip_image001[6]

Download: Basic - Hello World.7z

Last edited Jan 21, 2011 at 9:46 AM by SoulMaster, version 7

Comments

No comments yet.