I'm going to be back in Utah this coming Friday evening through Wednesday noon for work.
If any of the old SLGTest guys are reading this, feel up for dinner Friday night?
July 6, 2009
June 24, 2009
Unfortunately Accurate
June 22, 2009
Enforcing MaxLength On TextBox Controls
If you use ASP.NET, you've probably encountered situations where you need to restrict the overall length of input and you've tried using the MaxLength property on the TextBox controls.
For the most part, that works. Most browsers properly restrict the length on the client side. However, some browsers do not properly restrict the entry length, some browsers have loopholes that allow overlong entry (copy/paste, etc.), and you can't forget malicious users.
So you can properly restrict the sizes using ASP.NET's validators, do the following.
Drag over a CustomValidator and point it to the TextBox you want to enforce length limits on.
Point the CustomValidator's ServerValidate function to this function...
For the most part, that works. Most browsers properly restrict the length on the client side. However, some browsers do not properly restrict the entry length, some browsers have loopholes that allow overlong entry (copy/paste, etc.), and you can't forget malicious users.
So you can properly restrict the sizes using ASP.NET's validators, do the following.
Drag over a CustomValidator and point it to the TextBox you want to enforce length limits on.
Point the CustomValidator's ServerValidate function to this function...
protected void TextLength_ServerValidate(object source, ServerValidateEventArgs args)
{
CustomValidator v = (CustomValidator)source;
if (v != null)
{
TextBox t = (TextBox)this.FindControl(v.ControlToValidate);
if (t != null && t.MaxLength > 0)
{
args.IsValid = args.Value.Length <= t.MaxLength;
return;
}
}
args.IsValid = true; // If custom validator wasn't set up correctly, assume valid
}
June 6, 2009
Kait and Joel
This is my granddaughter Kait and Joel Hodgman from Mystery Science Theater 3000 and Cinematic Titanic.

I can't believe how much she has grown up. Tonight was her first live riff and she had a blast.
I can't believe how much she has grown up. Tonight was her first live riff and she had a blast.
May 24, 2009
Glenn Beck and Courts Overturning
I just want to say one thing regarding this little clip from Glenn Beck, one of the two loudest reasons I'm considering leaving the Republican party.
http://www.atheistmedia.com/2009/05/glenn-beck-californias-prop-8-about-to.html
Our Constitution has this particular separation of powers for one really good reason. It keeps the rights of the minority from being taken away or suppressed by the whims of the majority.
The exact same arguments were being made just over 30 years ago. Remember Loving v. Virginia?
http://www.atheistmedia.com/2009/05/glenn-beck-californias-prop-8-about-to.html
Our Constitution has this particular separation of powers for one really good reason. It keeps the rights of the minority from being taken away or suppressed by the whims of the majority.
The exact same arguments were being made just over 30 years ago. Remember Loving v. Virginia?
Subscribe to:
Posts (Atom)