ASP.Net US States Dropdown List

For large projects I usually databind my dropdown lists, but sometimes you just need a no-nonsense dropdown list of US States. For all you folks Googling to save time, here’s that code. Enjoy! 🙂 <asp:DropDownList ID="DropDownListState" runat="server"> <asp:ListItem Value="AL">Alabama</asp:ListItem> <asp:ListItem Value="AK">Alaska</asp:ListItem> <asp:ListItem Value="AZ">Arizona</asp:ListItem> <asp:ListItem Value="AR">Arkansas</asp:ListIt...

How To: NHibernate Parent/Child Relationships

So you’re trying to setup a Parent/Child relationship using NHibernate. This is easy enough when you allow the foreign keys to be null in your database. Of course this is not desirable for data integrity so you disallow nulls. Now NHibernate is pissed because it wants to insert the child row first then update it...

How to use Design view to edit a page inside nested Master Pages.

Here’s a quick tip. If you’ve used nested master pages in your ASP.Net web application and you’ve tried to enter the “Design view” in one of your nested aspx pages, you’ve probably seen this error message. Design view does not support creating or editing nested master pages. To create or edit nested master pages, use...

How to submit HTML without disabling ValidateRequest

So the scenario is this. You have an ASP.Net form field that you want the user to submit HTML to the server with. By default ASP.Net won’t allow this for security reasons. You could get around this by setting ValidateRequest=”false” in the page declaration or in the web.config. But, if you are developing a user...