Monday, May 7, 2012

ASP.NET MVC Authentication - Customizing Authentication and Authorization The Right Way

http://weblogs.asp.net/jgalloway/archive/2012/05/04/asp-net-mvc-authentication-customizing-authentication-and-authorization-the-right-way.aspx

ASP.NET MVC: Adding aria-required attribute for required fields

http://blogs.msdn.com/b/stuartleeks/archive/2012/05/01/asp-net-mvc-adding-aria-required-attribute-for-required-fields.aspx

@{
     var attributes = new RouteValueDictionary
                          {
                             { "class", "text-box single-line"}
                          };
     if (ViewContext.ViewData.ModelMetadata.IsRequired)
     {
         attributes.Add("aria-required", "true");
     }
}
@Html.TextBox("", ViewContext.ViewData.TemplateInfo.FormattedModelValue, attributes)

What is aria-required?

It is a HTML property to indicate if user input field is required. This property is for Accessible Rich Internet Applications
<input name="ariaexample" id="example" aria-required="true" aria-label="Test"/>

Reference:
http://www.w3.org/WAI/GL/WCAG20-TECHS/ARIA2.html