Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.

Monday, May 5, 2008

Multiple PostBack problem with GridView

I noticed my SelectedIndexChanged method being called twice in IE7 when I selected a gridview row. I used solution 2 at to solve the problem.

Resetting a StringBuilder

Here is how to reset a StringBuilder:

myStringBuilder.Length = 0;
myStringBuilder.Remove(0, myStringBuilder.Length) also works, but why bother with that one?