Posts

Showing posts from July, 2011

Duplicates on postback in your ASP.net Dropdown Box

Let's say you are working on a dropdown box letting the user select a state and a county. You might want to have the county be filtered by the state, so you add an autopostback event to the state dropdown. Let's also say, however, that you are allowing the search to proceed without selecting a county, so you add <asp:listitem Text="All Counties" Value="" /> as your first item and add appendDataBoundItems="True" to your counties dropdown. Because you have now enabled autoappend, the act of changing the state will cause a postback and keep appending counties to your county dropdown box. The solution? Add EnableViewState="False" to your Counties dropdown box. Yes, this may be obvious for some, but it's an easy thing to overlook and can lead you down a rather complex road of coding around viewstate that you may not want to explore.

SSL showing non-secure in some browsers?

Image
I have had a few cases recently where a customer will complain about a specific browser giving them a non-secure connection, or mix-ed mode error on some browsers. Most commonly, older versions of IE are the culprits, but I have seen a case where Firefox 4 showed a page as non-secure while IE8 and 9, Chrome and Safari all had no issues with it. When your customers are banks, you want to make sure even their customers running obsolete IE6 and IE7 browsers see the padlock, despite the other mountain of issues involved with supporting older browsers. Any one little item can be the culprit. Some browsers don't consider certain connections to be an issue, while others do. The obvious things to check first are script source paths for js libraries, etc... Make sure those are using https. As of the time I am writing this, embedded Google maps cannot be on an SSL page. However, when all else fails and you find yourself sifting through nested js files and searching for image source paths tha