Tutorial by Examples

First we need to make a ViewModel. Make a new folder /Models/Account, and add the file MemberLoginViewModel.cs to the folder. using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace MyCMS.Models.Account { ...
Then make a view in the folder /Views/MacroPartials/Account @model MyCMS.Models.Account.MemberLoginViewModel @using MyCMS.Controllers.Account @if (User.Identity.IsAuthenticated) { <p>Logged in as: @User.Identity.Name</p> using (Html.BeginUmbracoForm<MemberLogin...
Make a new controller in the folder /Controllers/Account. Name the file MemberLoginSurfaceController.cs using MyCMS.Models.Account; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Security; namespace MyCMS.Controll...
To render your new component in a view, you cust call: @Html.Action("MemberLoginForm", "MemberLoginSurface")

Page 1 of 1