Agility CMS documentationAgility CMS documentation
OverviewEditorsDevelopersOwners & AdminsTraining GuideApps
Sign inLet's Chat
.NET
Agility and .NETGetting Started with Agility CMS and .NETHow Components Work in .NETHow Page Models Work in .NETHow Pages Work in .NET

Introduction

Agility and .NET

Step-by-step guide to getting started with Agility CMS and .NET — Blazor SSR and MVC/Razor Pages starters, content fetching, and Azure deployment.

Build fast, SEO-optimized websites using .NET and Agility CMS. Whether you're creating a marketing site, blog, or enterprise application, this guide will help you leverage the power of .NET with Agility's headless CMS.

Why .NET with Agility CMS?

.NET is Microsoft's powerful, cross-platform framework for building modern web applications. Combined with Agility CMS, you get:

  • Server-Side Rendering (SSR) for SEO-friendly, fast-loading pages
  • Editor-Driven Pages where content editors control the sitemap without developer intervention
  • Flexible Content Modeling with strongly-typed C# classes
  • Enterprise-Ready architecture with built-in caching and performance optimization
  • Azure-Native deployment with one-click setup

Choose Your Starter

We provide two production-ready starters for building websites with Agility CMS and .NET:

StarterFrameworkBest ForInteractivity
Blazor SSRBlazorModern apps, interactive UIsServer-side + optional SignalR
MVCRazor PagesTraditional web appsServer-side only

Both starters include:

  • Dynamic page routing based on Agility sitemap
  • Component-based architecture
  • Preview mode support
  • Tailwind CSS styling
  • One-click Azure deployment

The Agility SDK

The Agility .NET SDK consists of a NuGet package for accessing content:

Agility.NET.FetchAPI

dotnet add package Agility.NET.FetchAPI

Capabilities:

  • Fetch pages and sitemaps
  • Retrieve content items and lists
  • Query content via GraphQL
  • Handle preview mode
  • Typed responses with generics

Quick Start

Clone the starter repository and choose your preferred framework:

git clone https://github.com/agility/agilitycms-dotnet-starter.git
cd agilitycms-dotnet-starter

# For Blazor SSR
cd Agility.NET.Blazor.Starter

# Or for MVC/Razor Pages
cd Agility.NET.MVC.Starter

# Configure your credentials in appsettings.local.json
# Then run
dotnet watch

See the Getting Started guide for detailed setup instructions.

Documentation

Getting Started

  • Getting Started - Set up your first Agility + .NET project

Starters

  • Blazor SSR Starter - Modern Blazor with optional interactivity
  • MVC Starter - Traditional Razor Pages approach

Core Concepts

  • How Pages Work - Dynamic page routing and the sitemap
  • How Components Work - Building reusable content modules
  • How Page Models Work - Defining page layouts and zones

Development

  • Fetching Content - REST API, GraphQL, and typed responses
  • Configuration - Settings, environment variables, and caching

Deployment & Operations

  • Deploy to Azure - One-click deployment and CI/CD setup
  • Migration Guide - Upgrading from older .NET versions

Sample Code

Fetch a Content List

// Using the FetchApiService
var posts = await FetchApi.GetTypedContentList<Post>(
    referenceName: "posts",
    locale: "en-us",
    take: 10
);

Render a Component (Blazor)

@* RichTextArea.razor *@
<div class="prose max-w-none">
    @((MarkupString)(Fields?.TextBlob ?? ""))
</div>

@code {
    [Parameter] public RichTextArea? Fields { get; set; }
}

Render a Component (MVC)

// ViewComponent
public class RichTextArea : ViewComponent
{
    public IViewComponentResult Invoke(ModuleModel module)
    {
        var fields = module.Model.Fields.ToObject<RichTextAreaFields>();
        return View(fields);
    }
}
@* Views/PageModules/RichTextArea.cshtml *@
@model RichTextAreaFields

<div class="prose max-w-none">
    @Html.Raw(Model?.TextBlob)
</div>

Resources

  • GitHub Repository
  • Agility CMS Documentation
  • NuGet: Agility.NET.FetchAPI

Get Help

  • Agility CMS Community
  • GitHub Issues
  • Contact Support
Next →
Getting Started with Agility CMS and .NET
On this page
Why .NET with Agility CMS?Choose Your StarterThe Agility SDKQuick StartDocumentationSample CodeResourcesGet Help
Agility CMS documentationAgility CMS documentation

Documentation for the CMS built for editors, developers, and AI agents.

Docs
  • Overview
  • Editors
  • Developers
  • Owners & Admins
  • Training Guide
  • Changelog
Resources
  • Get Support
  • MCP Server
  • System Status
  • llms.txt
Agility
  • agilitycms.com
  • Start Free Trial
  • Sign in
  • Blog
© 2026 Agility Inc. All rights reserved.
Privacy PolicyTerms of Service