CraigWardman.com

[ November 2008 Archives ]

/Blog/Archive

Monthly Archives: November, 2008

Matching Tags using Regular Expressions Balancing Groups

The regular expressions engine provided by the .NET Framework includes a new feature known as ‘balancing groups’. This feature allows you to increment/decrement the match count of a named capturing group by giving the group a positive and negative match context. You can then test to see you have an equal number of matches, by [...]

LINQ Select Distinct on Custom Class Property

The standard LINQ .Distinct() function will pass your IEnumerable items to the ‘default comparer’ to differenciate the items. If your IEnumerable contains objects of an arbitrary class you would ordinarily have to create a IEqualityComparer to compare the relavent property of each instance. This seems like too much work just to simply remove objects that [...]

ScriptManager Service Reference and HTTPS

If you use the ASP.NET AJAX script manager with a service reference to a local WCF service, then you may encounter problems when using HTTPS on the page. If you have not configured your service for use with HTTPS you will most likely receive ‘xyzService is not defined’ errors in your Javascript. This is because [...]

ASP.NET URL Rewriting and Tilde

In ASP.NET controls you can use the tilde ‘~’ character to signify the virtual application root of the website, for example when sourcing an image for an ImageButton. Code: <asp:ImageButton ID="ImageButton1" runat="server" AlternateText="Example Button" ImageUrl="~/images/button.png" /> This is fine for most cases. However, when using URL rewriting (via HttpHandlers) it can become a problem, since [...]

CraigWardman.com
Car Leasing | Lease Cars