Last active
September 21, 2016 23:10
-
-
Save teamaton/9cefacb47721baac8971124ba8ea513e to your computer and use it in GitHub Desktop.
A special-purpose TextBox derivative that automatically trims whitespace from its Text value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// LICENSE: MIT | |
using System.Web.UI.WebControls; | |
namespace Generic.Frontend.Web | |
{ | |
public class TrimTextBox : TextBox | |
{ | |
/// <summary> | |
/// Returns the text entered, but with leading and trailing whitespace removed. | |
/// </summary> | |
public override string Text | |
{ | |
get { return base.Text.Trim(); } | |
set { base.Text = value; } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment