Kendo UI allows you to create a “value template” which defines how the selected values are displayed in a DropDownList when it is closed.

image

Usually this value comes from the text field you specify either in the configuration options in JavaScript or in the data-attributes used to configure the widget.

<select data-role="dropdownlist"
 data-text-field="first"
 data-value-field="id"
 data-bind="source: dropDownData"></select>

  

Sometimes you want to be able to specify multiple properties in your value template. If you’ve tried this before, you’ve probably run into the limitation that these properties must ...

A lot of web applications now include a lot more JavaScript code than they used to. The better designed ones will usually take steps to make sure that all that JavaScript code is well organized, including making sure it’s not mixed in with the HTML views. In my applications, I’ll often create a single JavaScript file per view. When I place these files in the appropriate locations (~/Scripts and ~/Views) in my ASP.NET MVC application, its causes me to create two parallel directory structures, one in each location..

I recently set out to figure out how to move all my ...

IMG_2140I had a great time speaking at (and organizing) GR DevDay this weekend. We had a great lineup of amazing speakers, including Falafel’s own Josh Eastburn on Kendo UI, and CEO Lino Tadros delivering the keynote. The feedback from attendees has been very positive, so it sounds like everyone else has just as good a time as I did!

I’d like to thank everyone that was able to attend my session, “30 Tools for Modern .NET Web Development in 60 Minutes”. For those that missed it, I talked about 30 of the tools that I use almost ...

The Mystery

I’m hosting a website on a shared hosting server. This site uses Forms Authentication to generate the session cookie that authenticates my users. Everything worked fine with the site, including authentication, until I tried to make it so my authentication cookies didn’t expire every 20 minutes, which is the default expiration setting for Forms Authentication.

NOTE: For more on setting up Forms Authentication on your site, check out my blog post on that subject

With the timeout happening nearly every 20 minutes, I figure that simply changing the Form Authentication timeout from 20 minutes to 1051897 minutes ...

I often find that developers feel uncomfortable setting up Forms Authentication in their web applications. Maybe it’s because it’s often added for them in the various project templates provided by Visual Studio, or maybe it’s because it’s difficult to distinguish Forms Authentication from it’s buddy Membership Services, which is much larger and more complex.

Whatever the reason, I thought I would create this post and do my small part to demystify the process of adding Forms Authentication to your project. For the purposes of demonstration, I started with an empty ASP.NET MVC5 project. Here are the steps:

  1. Enable forms authentication...

Adjusting to High-DPI Scaling

imageScott Hanselman has a great blog post about how life on a high-DPI computer can be painful.  A couple of weeks ago, I upgraded to a high-DPI laptop (the Samsung Ativ Book 9 Plus). It has a 3200 x 1800 native resolution, which has 278% of the pixel-area of my previous full-HD screen, but in only 13 inches compared to the 15 inches of my older model.

Needless to say, on my new laptop, it’s very important to turn on DPI-scaling to make things readable on this monitor. For those not familiar with DPI-scaling, ...

One of the best things about using a compiled language over a scripting language is that you get compile-time checks that prevent run-time errors later. ASP.NET MVC uses a hybrid approach by default. Views are compiled at run-time, but controllers, models, and other classes are pre-compiled. MVC also allows you to create strongly-typed views, but since those views aren't compiled until run-time, you don’t always get warned about changes to your models (like property name changes) or other errors in your view until it's running.

There’s a simple way to change this, though, by setting the views to build at ...

If you’ve been using database-first Entity Framework for a while, it’s time you tried code-first Entity Framework. It’s actually much easier to use in a lot of ways, and creates a lot less cruft than database-first EF.

Despite the name “code-first” you don’t actually have to write the model code first before creating your database. If you’ve already got a database, there is a great Visual Studio add-in called Entity Framework Power Tools that will help you do just that. After connecting the wizard to your database, it will create a context class, entity classes, and mappings, all as POCO ...

My friend and fellow Falafelite Adam Anderson wrote a great blog post a couple of months back about how to create a batch file to open IIS Express from any path. I’ve been using it ever since and loving it, but had a brain storm recently. I thought: “What if I could use this by right-clicking on a directory instead of running a batch file?”

So, I created a simple Windows Explorer shell extension that allows me to right-click any directory in Windows Explorer and open an IIS Express site there. I’ve packaged it in a registry file so ...

Thanks to everyone who came out to my session yesterday at DevReach on developing mobile apps in HTML5 and JavaScript using Icenium. I've posted the slides and code examples from the session below. Please feel free to contact me if you have any questions.

Crafting Cross-Platform Mobile Apps with HTML, CSS, and JS in Icenium

 

Now that the Icenium team has announced a new Visual Studio plug-in, some developers may want to port their projects from Icenium Graphite or Icenium Mist to Visual Studio. Unfortunately, in spite of a lot of really great features offered in v1 of the plug-in, porting an existing project is not a supported scenario (see the documentation).

I'm sure the Icenium team will get around to implementing this feature eventually. They're working very quickly through a long list of feature requests, so it's just a matter of how important this feature is to the community. If this feature ...
Thanks to everyone who came out to my session today on developing mobile apps in HTML5 and JavaScript with Icenium. I've posted the slides in this blog post. Please feel free to contact us if you have any questions.

Cross-Platform Mobile Apps with HTML5 using Icenium
Thanks to everyone who came out to Rachel and my session today on introducing.NET developers to Objective-C and iOS development. I've posted our slides in this post. Please feel free to contact us if you have any questions.

iOS for .NET Devs Slides
Writing modern JavaScript typically means using JQuery and the miriad libraries that are built on top of it. If you transition to this new paradigm  from the old one of programming directly against the DOM (document object model) objects, it can be especially confusing.

In this blog post, I'd like to show you some different types of objects you may encounter while doing modern JavaScript development. This will include DOM objects and a couple of modern JS libraries--JQuery and Kendo UI.

The DOM

The Document Object Model (DOM) is a cross-platform convention for interacting with objects in HTML documents. (adapted ...
I ran into an error when I was setting up a project in Visual Studio for an existing Windows 8 app I already had installed from the Windows 8 Store. When I tried to run the project in the debugger for the first time, I got the following error message:

Error : DEP0700 : Registration of the app failed. Another user has already installed a packaged version of this app. An unpackaged version cannot replace this. The conflicting package is [MyProjectName] and it was published by [MyCertificate]. (0x80073cf9)


This seemed odd to me since I had already uninstalled the app ...
I was recently helping a client code-sign their project for distribution over the Internet when we ran into a problem. They referenced a couple of pre-compiled .NET assemblies that were used by the main project but hadn't been strong named. To be able to sign code in .NET, all the assemblies contained in that code need to have a strong name. 

Normally, you'd just go into the project settings for any unsigned assemblies and set up strong name signing there. However, since I didn't have the original code, I had to follow a different path. Here's an outline of the ...
UPDATE (Mar 20, 2013): Icenium v1.3 was released yesterday with built-in zipalign format!

read more...

Last week I published a review of my first Icenium project. I wanted to go into a little more detail on one issue I ran into which confused me during the publication process of the Android version of my Icenium app.

Publishing for Android from the Icenium IDE signs the package file, but it doesn't do something else that is required. It's called zip aligning. If you try to upload the APK file that Icenium produces, you will most likely get the following error ...
UPDATE (Mar 20, 2013): Icenium v1.3 was released yesterday with the ability to target iPhone or iPad only on iOS, one of my suggestions below. Thanks, Telerik team!

read more...

I'm just wrapping up my first project using Icenium, Telerik's cloud-based IDE for creating Android and iOS apps using HTML5, CSS3, and Javascript. I must say that it's been a very enjoyable experience and I've been very impressed with the product that our friends at Telerik have created.

It's a bit unfair to do a full review of this product yet, since it's so new and still in v1. ...
Since late 2012, Microsoft has been offering access to an Windows Azure-hosted Team Foundation Server (TFS) which they branded as "Team Foundation Service". At the beginning of the year, they took (most of) this service out of beta and announced that it would stay free for teams of 5 or less. The pricing for bigger teams hasn't been announced yet, and remains free currently, and is likely to be very affordable going forward.

For a lot of companies, Falafel included, this is a very compelling option. This service already gives you all the benefits of a cloud-hosted source control repository: ...
If you've looked at JavaScript recently after any kind of hiatus, you've probably noticed that the language has changed a little in the last few years. Technically, the language hasn't changed so much as the way we use it has. 

One of the most noticeable changes--besides the daily multiplying list of new libraries and frameworks--is the object oriented way in with the language is used. For instance, instead of just creating a sea of functions, you might now create your JavaScript code in classes of related functionality:

var mathObj = {
    writeToLog: function (message) {
        console.log(message);
    },
 
    ...