Archive by Author

Line Breaks in ConfirmButtonExtender

I expected to type \n into the ConfirmText property of the AJAX Control Toolkit’s ConfirmButtonExtender and get a new line. This doesn’t work, but you can use this character code: 
 Specifically, ampersand pound ten semicolon.

ASP.NET 4.0 Custom Error Pages Very Slow to Load

When I upgraded to ASP.NET 4.0, runtime errors suddenly became very slow. There was a consistent two-minute delay before my custom error page would appear. The rest of the website was lightning fast, so it was not related to compilation. I finally decided to tackle this problem, so I started copying blocks of code into a new, blank custom error page. The delay was not present until I […]

Binding jQuery events to ASP.NET controls in an UpdatePanel

Controls inside an ASP.NET UpdatePanel cannot be bound to jQuery events after a partial postback. Here are some tips using pageLoad(): http://forums.asp.net/p/1189519/2039138.aspx http://encosia.com/simplify-aspnet-ajax-client-side-page-initialization/

ASP.NET MultiLine TextBox MaxLength Validation

There have been many articles and forums addressing the fact that the MaxLength property of the ASP.NET TextBox does not work when you set TextMode to MultiLine. The majority of these solutions use the KeyPress and OnBlur events. This brings with it lots of JavaScript and a host of browser issues. I was impressed by […]

SQL Server Unique Index with Multiple NULL Values

Sometimes I require unique values in a column that allows nulls. CREATE UNIQUE NONCLUSTERED INDEX IndexName ON dbo.TableName(ColumnName) WHERE ColumnName IS NOT NULL http://connect.microsoft.com Update: SQL Server Management Studio has this functionality built into the Index Properties dialog. ([ColumnName] IS NOT NULL) http://stackoverflow.com

Remote Desktop Services Multiple Sessions

As far as I can tell, it is trivial to enable multiple simultaneous remote desktop sessions for Windows Server 2008. Open gpedit.msc Navigate to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections Double-click “Restrict Remote Desktop Services users to a single Remote Desktop Services […]

Entity Framework Count Child Entities

Expanding on the post “Entity Framework Filter Child Entity“, I finally figured out how to get a GridView to show the count of child records. Unfortunately I am returning the whole set of entities and doing a Count on them. It’s not a problem in this case. I’m just happy it works. Dim query = […]

Grant Alter Trace Permission SQL Server Profiler

SQL Server Profiler requires you to have ALTER TRACE permission. There are two ways to grant that permission. Properties: Object Explorer -> Security -> Logins -> your_login -> Securables -> Search button -> “The server” radio button -> “Grant” checkbox on “Alter Trace” SQL: GRANT ALTER TRACE TO myuser

How to Hash Passwords for XML Files

To save a password hash to an XML file, you can call this function: FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text & "|" & txtUsername.Text, "SHA1") You can see my attempt at a password salt by simply apppending the Username.