The article below has a minor improvement to the previous article listed on this web site. Specifically, the previous article used the DropDownList as a mechanism to actually retrieve the data for the purposes of storing it in a local Dictionary. This article simply calls the ObjectDataSource directly to retrieve an IEnumerable type and iterates over that. Below is article with the updates. (Original Article is: http://peterkellner.net/2006/08/30/smalllistaccess/)

Most data driven web sites have to manage lots of small lists. Examples include things like states, countries, levels, and even things like sex where you may only have two choices. (especially if you have internationalization issues). The simplest way to store this information is in static lists simply defined programatically. Below is an example of this.

(more…)

ASP.NET 2.0 Membership

A very common question that comes up while using ASP.NET 2.0 Membership is that when moving a web application from the local developer environment with Visual Studio 2005 (VS2005) to IIS is that login no longer works. Almost everytime this happens, it comes down to the application name in the Membership Profile of Web.Config is set to / instead of the actual application name. That is, if you you were to look at your web.config, this is what you would see.

(more…)

We often want to have a gridview which selects items based on a dropdownlist. It’s trivial to do this in the VS2005 designer by simply first creating an SqlDataSource with a where clause, then with the sqldatasource wizard, assign the SelectedValue of the dropdownlist to the GridView.

The application running looks like this:

(more…)

© 2005 PeterKellner.net. All Rights Reserved