ASP.NET Tip: If your DropDownList items are lost on postback

This might seem obvious but it had me stumped for a while. Most ASP.NET programmers should know that if you set EnableViewState to false on a DropDownList, the items that were bound to that control will not be persisted on postback. What you might forget (as I did) is that if your DropDownList (or any other DataBound control for that matter) is held within another control (such as a Panel) that has viewstate disabled, then it also applied to anything contained within that control.

I added a DevExpress Panel to my MasterPage surrounding a ContentHolder, then wondered why none of my DropdownLists were working correctly.

Mental note to myself this one….

Fixing the iPhone midnight reminders

Anyone that syncs Microsoft Outlook with their iPhone will probably have experienced the midnight wake up, only to find that a work colleague is going on holiday, or someone has a birthday.

Outlook doesn’t have a default way of seeing all appointments that have reminders, but it is fairly easy to do. Go to your calendar and click on Views -> Define Views.

Click New (or Copy an existing Calendar View). The settings you want are as follows:

  • Fields: Icon, Subject, Location, Start, End, Recurrence, Categories, All Day Event, Reminder
  • Group By: None
  • Sort: Recurrence (Ascending), Start (Ascending), End (Ascending)
  • Filter: Advanced – Add two new fields: All Day Event equals yes and Reminder equals yes

Name your view “All day events with reminders”.┬áNow flick back to the calendar and apply that view under Current View. You’ll see a view not too dissimilar to this:

You can now identify those all day events that have reminders. For birthdays, you may want to change the reminder time to something more friendly. For holidays, you can simply click on the reminder icon and the reminder will be removed.

When you next sync your iPhone, you’ll find that you won’t be woken up at midnight any more.