September 2009 Entries
We have several MS Reporting Service Reports at my company that were using a parameter that I’ll call “Person”. We display the reports on our ASP.NET Website and when a report is selected that needs the Person parameter we show a Person DropDownList. For some reason this was working fine on several reports, but not for a new report. We verified through the Reporting Service interface and by looking at the actual parameter data in the database that everything looked correct. The Person parameter for...
I’ve been doing a lot of refactoring lately and I’ve decided to list out a couple of common issues I found with code that I’ve come across in several projects I have worked on. One of the most common themes I’ve seen in ASP.NET projects is Business logic code in the Click Events. It is really frustrating to see several hundreds of lines in one Event. Please do not put ANY Business logic and especially no Data Access code in there! There are several reasons why, but the biggest reason I have come...
I needed to do a quick sort on a DropDownList Server Control and found a great way of doing it in just 4 lines of code. Your project will need to be pointed to the .NET 3.5 Framework and will need a reference to System.Linq. List<string> list = DropDownList.Items.Cast<... => item.Text).ToList(); list.Sort((x, y) => string.Compare(x, y)); DropDownList.DataSource = list; DropDownList.DataBind();