Huy Nguyen has a great write up on implementing a generic repository interface that supports Entity Framework 4. His code is written in C# and today I had to rewrite it in VB.Net. The VB.Net version looks like this Public Interface IRepository Inherits IDisposable Function GetQuery(Of TEntity As Class)As IQueryable(Of TEntity) Function GetAll(Of TEntity As Class)() As IEnumerable(Of TEntity) Function Find(Of TEntity As Class)(predicate As Expression(Of Func(Of TEntity, Boolean))) As IEnumerable(Of TEntity) Function [Single](Of TEntity [...] Read more »
ASP.NET DropDownList always fires SelectedIndexChanged

After a couple of days trying to get to grips with a misbehaving custom compositecontrol I finally located the issue to a feature/bug in the framework implementation of DropDownList and ListControls in general. There is an issue logged on Microsoft Connect but it has been closed as “by-design”. I don’t think that this behavior really is by-design but there are two contradicting features interacting with each other leaving Microsoft with no other choice but to [...] Read more »
Break-down of javascript mobile frameworks for phonegap development

I am experimenting with PhoneGap for a couple of projects that I am currently working on. PhoneGap is a native mobile app packager which basically converts a html5/js based site into an app that will run on mobile phones and can be distributed via app store/market. Since PhoneGap merely leverages existing support for html5 and javscript in the mobile phone you have pretty much the same issues as when developing a regular mobile enabled web [...] Read more »
Don’t Base64 encode things that users should enter
Base64 encoding is great for converting binary data into a string representation which can be transported over text based protocols like soap or json. Unfortunately Base64 uses a character set which is difficult for humans to interpret so for any data that needs to be human interpretable, like binary representations added to urls, base64 can be a real problem. Douglas Crockford solved this issue years ago with his special Base32 encoding scheme which uses a [...] Read more »