MVC Examples

Agility Template

<@ Page Title="" Language="C#" Inherits="Agility.Web.Mvc.AgilityPageTemplateView" %>

<!DOCTYPE html>
<html>
  <head>
    <!-- content here -->
  </head>
  <body>
    <section class="MainContent">
      <% Html.RenderContentZone("MainContent"); %>
    </section>
    <section class="Sidebar">
      <% Html.RenderContentZone("Sidebar"); %>
    </section>
  </body>
</html>

Custom Module Controller and Partial View

Assuming that a Rich Text Area module with a property called "TextBlob" has configured, and the output has been set to use the "Module" Controller and "RichTextArea" Action, you could handle the output of this module with the following:

using System.Web.Mvc;
using MyWebsite.Models;

namespace MyWebsite.Controllers
{
  public class ModuleController : Controller
  {
    public ActionResult RichTextArea(Module_RichTextArea moduleItem)
    {
      // do something interesting
      return PartialView("RichTextArea", moduleItem);
    }
  }
}

The corresponding partial view, /Views/Module/RichTextArea.ascx, might look like:

<@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyWebsite.Models.Module_RichTextArea>" %>

<%= Model.TextBlob %>

LOGIN

Log in with your Agility username and password or
register for the site




Log In

REGISTER












Register

FORGOT PASSWORD