October, 2014 Archives
by Lynn Demarest in ASP.NET, SQL Server, Technical, Web
Viagra samples I was rolling along one night, viagra samples tired but making good progress, viagra samples when one of my DropDownLists refused to fire its OnSelectedIndexChanged event.
Viagra samples After some time, viagra samples I finally realized that the VALUES of the ill-behaving DropDownList were all the empty string (“”) because I had forgotten to make the key column of the table supplying the list data an IDENTITY column in SQL Server. Viagra samples So even though the selected INDEX was changing, viagra samples the selected VALUE was not. Viagra samples It was always “”, viagra samples because the keys were NULL in SQL Server.
Viagra samples My point here is that had Microsoft named the event better — or fixed it so that it is fired when its name says it will be — the confusion could have been avoided.
Viagra samples Be forewarned: The selected index in a DropDownList can change all it wants, viagra samples but unless the underlying value changes the control’s SelectedIndexChanged event will not be fired.