---
title: TextCounterHelper
summary: API reference for TextCounterHelper.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-09-17
library: SAIF.Framework.Web.Mvc
reference_type: package
---

# TextCounterHelper

Renders a labeled `<textarea>` carrying `data-start-length`/`data-max-length` attributes that client-side script uses to show a live character count, defaulting to a 4000-character maximum.

## Purpose
- Renders a labeled `<textarea>` carrying `data-start-length`/`data-max-length` attributes that client-side script uses to show a live character count, defaulting to a 4000-character maximum.

## Context
- Namespace: `SAIF.Web.Mvc.UI.Extensions`
- Assembly/package: `SAIF.Framework.Web.Mvc (source-shipping NuGet package)`
- Kind: static class

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| TextAreaCounterFor<TModel,TProperty> | `public static MvcHtmlString TextAreaCounterFor<TModel, TProperty>(this HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, string labelText = null, object htmlAttributes = null, int startLength = 0)` | Strongly-typed overload that always applies the 4000-character default maximum (see [BR-52](../../business-rules.md#br-52-strongly-typed-textarea-counter-always-uses-the-4000-default)). |
| TextAreaCounter(this HtmlHelper, string name, string labelText = null, object htmlAttributes = null, int startLength = 0, int maxLength = 4000) | `public static MvcHtmlString TextAreaCounter(this HtmlHelper html, string name, string labelText = null, object htmlAttributes = null, int startLength = 0, int maxLength = 4000)` | Renders the label (or a bare span when no label text resolves) followed by the counted textarea; see the "Render a character-counting textarea" operation. |

## Sources
- `src/Web.Mvc/UI/Extensions/TextCounterHelper.cs`
