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 http://www.codeproject.com/KB/aspnet/GVImageCommandButtonProb.aspx 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?
References: http://forums.asp.net/t/1193708.aspx