MVC Examples

Agility Template

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

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

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 %>


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

Log In