Posts

Showing posts from September, 2011

data-placeholder in MVC3

I ran into an interesting problem this evening with a very quick fix. I’m using the very neat chosen Javascript plugin ( link ) to add some aesthetic and functional sugar to a website’s existing dropdowns. Anyhow, adding default text support (e.g. “Please choose an option”) to a multiple select dropdown is achievable using data-placeholder like this: < select data-placeholder=" Choose a country... " style=" width:350px; " multiple class =" chzn-select ""> Problem is, I am using ASP.NET MVC’s helper syntax to create my dropdownlists and “data-placeholder” is invalid syntax due to the dash character. The following does not work: @Html.DropDownListFor(m => m.SelectedProductIDs, Model.AvaliableProducts.ToSelectList(" ID "," Name "), new { @ class = " chzn-select ", data-placeholder=" Please select a product " }) Happily, Microsoft pulled a rabbit out of the hat and as of MVC3 underscores in html

My First Experience with Windows 8

Image
I guess running in a VM was a bad idea then… I wonder will the soothing BSOD thing catch on :-)

gitignore–Don’t ignore Nuget Binaries

I am pretty new to the GIT world and am excited to be moving a personal project from Subversion to GIT. As with most .NET developers’ .gitignore files, I use the following line to filter out DLLs so that I am not versioning build DLLs *. dll I ran into an issue where I wanted to exclude all DLLs except for those stored in my Nuget packages directory. This wouldn’t in itself be an issue were it not for the fact that Nuget packages diverge wildly with respect to the number of nested sub-folders. Where one package might store it’s DLLs one folder down the directory hierarchy, another might store theirs down 10… I searched for a recursive wildcard pattern that would work via mysysgit but hit a brick wall as none of the following worked: !/ packages /** /*.dll !/packages/**/* While I hoped for a cleaner solution it turned out that all I had to do was add another .gitignore to my packages directory containing only the following line: !*. dll Obviously this would work just a