in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, MOSS 2007, ASP.NET, LINQ, and Visual Studio 2012.

SetFocusOnError Property

Another new property added to validator controls is the SetFocusOnError property.  This new property allows a developer to force focus on the control that did not pass validation.  This will be an excellent imrpovement for forms such as Blue Chip enrollment.  To force the focus, simply set the SetFocusOnError property to true.
 
<asp:TextBox ID="TextBox3“ runat="server“ />
 
<asp:RequiredFieldValidator  SetFocusOnError="true"
 ErrorMessage="TextBox3 is empty"   ControlToValidate="TextBox3"
 runat="server“/>

Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=117

2012 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems