# Thursday, August 23, 2012

As most of you know I am very active in the development community and one piece of that is my involvement with the Midwest Give Camp organization. The Midwest Give Camp organization is a small group of dedicated community leaders that plan and carry out yearly Give Camps in the Midwest. This year I had the honor of organizing/leading the Midwest Give Camp. The event was held the weekend leading in to That Conference at the same venue. I wanted to share details on the charity that we worked with and what the Give Campers were able to provide for them.

For the 2012 installment of the Midwest Give Camp we worked with the charity Katharine’s Wish. Katharine’s Wish was founded by Katharine Rhoten of Eau Claire, WI. Katharine’s father Doug is also an active member of the developer community who runs the Chippewa Valley .NET User Group. Doug also happens to be a personal friend of mind.

While on the family’s first trip to Disney World in 2008 Katharine became seriously ill and was rushed to the hospital. The Rhoten family spent 3 long days in the hospital watching Katharine undergo numerous tests, most involving painful prods and pokes. Through all of those procedures Doug and his wife Kristin where amazed at the positive attitude Katharine was able to keep. This was due, in large part, to a small gesture of the hospital staff. Prior to any painful procedure, the hospital staff gave Katharine a small stuffed animal. This always put a smile on Katharine’s face and let her know that it may hurt for a bit but in the end everything was going to be alright. To get an idea of the number of procedures Katharine was subjected to during her stay at the hospital…Doug had to ship 2 boxes of stuffed animals back to WI J

The experience provided two major life-changing events for Katharine. The first was that she was diagnosed with Type I Diabetes and the second that she vowed to “pay it forward” by doing everything she could do to make sure that children in the hospital have the same positive experience she had. Upon returning home Katharine got to work on making this happen by using her allowance, birthday money, and funds from a lucrative lemonade stand to purchase stuffed animals to donate to local hospitals that she donates each year, on the anniversary of her diagnosis, to local hospitals.

Katharine’s Wish has grown to now include multiple drop off locations where the community can drop off stuffed animals and books to be donated. In the five years since her diagnosis, Katharine, with the help of her younger brother Spencer, has donated thousands of stuffed animals and books to the hospitals in her community.

It was an honor to be able to use my skills, along with the skills of 12 other talented geeks, to provide Katharine with a platform to grow her cause. The result of our work is the official Katharine’s Wish web site. The site was coded in MVC 4/HTML5/Kendo UI on the front end and EF Code First/SQL on the back end.

I ask that you please check out http://www.KatharinesWish.org to learn more about this awesome girl and please consider donating to her cause.

posted on Thursday, August 23, 2012 4:22:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [5]
# Wednesday, August 01, 2012

Last month I had the awesome opportunity to be part of the aspConf virtual conference.  aspConf evolved from the very popular mvcConf, but instead of being focused solely on ASP.NET MVC aspConf is focused on the entire ASP.NET stack of goodness.  The great thing about aspConf is that it is a virtual conference allowing for a much broader audience.

I presented two sessions at aspConf:

  1. Test Driving ASP.NET MVC - (slides and code)
  2. Kendo UI - Lighten Your Load by Adding a Sword(slides and code)

The aspConf staff also put in the immense effort of editing every session and making them available on Channel 9 for everyone to watch.

If you missed aspConf this year, well you can always watch it on Channel 9, but also make sure you follow them on Twitter and keep on eye on the aspConf site so you don’t miss next year’s event!

posted on Wednesday, August 01, 2012 6:28:16 AM (Central Daylight Time, UTC-05:00)  #    Comments [3]
# Friday, June 29, 2012

A great new feature in ASP.NET MVC is the ability to bundle scripts and CSS files and register them as a group.  More detail on this functionality can be found here.  Because by default all the scripts and CSS classes in a new MVC 4 project are registered using bundles I felt a little dirty in my previous posts referencing my Kendo UI scripts and CSS files each individually.  I rectified that.

So I started the rectification process by adding entries to the BundleConfig.cs.  In this file is where you create and configure your bundles.  Out of the box there are a number of bundles configured so all I needed to was follow the same conventions when creating my bundles. 

bundles.Add(new ScriptBundle("~/bundles/kendojs").Include(
bundles.Add(new StyleBundle("~/Content/kendocss").Include(

Obviously I took the least amount of scripts I needed to get my contrived sample created, but you can add whatever scripts you need.

After creating the bundles I need to register or “Render” them as the method is called.  Have to admit I am not a fan of “Render” as the method name.  In the past “Render” has always had a visual connotation.  The registering of the bundles for this example is taking place in the _layout.cs, but you could do the same thing directly in your ASP.NET MVC View.

@Styles.Render([...other CSS bundles], "~/Content/kendocss")
@Scripts.Render([...other Script bundles],"~/bundles/kendojs")

And that’s it.  Now I have my Kendo UI scripts and CSS files registered/referenced/rendered using the new bundling features of ASP.NET MVC

Code is available on GitHub.

posted on Friday, June 29, 2012 3:38:27 PM (Central Daylight Time, UTC-05:00)  #    Comments [4]
# Monday, June 25, 2012

Note: If you are following along at home you may have noticed that the number of the series posts has changed.  I have taken some *poetic license* and decided that the previous post introducing Kendo UI for ASP.NET MVC was actually part part 3 of the original series on Kendo UI in ASP.NET MVC as well as part 1 of a new series on Kendo UI for ASP.NET MVC.  Clear as mud, right?

To stay in line, and catch up, with the pre-Kendo UI for ASP.NET MVC series this post is going to show you how to implement the Kendo UI AutoComplete control using the HtmlHelper extension.  In case you didn’t catch the original post on implementing the AutoComplete using Kendo UI (core/non-mvc) in ASP.NET MVC, the Kendo UI AutoComplete control is a text box that has an associated list of items that when text is entered into it a suggestion list is displayed allowing the user to select an item.

To get started follow steps 1 - 6 in the previous post to prep a new solution.

Next I created a server side model: Manufacturer.cs

namespace Part2_AutoComplete.Web.Models
    public class Manufacturer
        public int Id { get; set; }
        public string Name { get; set; }

As you can see the view the model is a very simple class that contains only an Id and a Name field.

After that I created my view: Index.cshtml

@using Kendo.Mvc.UI
@model IEnumerable<Part2_AutoComplete.Web.Models.Manufacturer>
    ViewBag.Title = "Kendo UI for ASP.NET MVC: Part 2 - AutoComplete";
    .DataSource(source => {
            source.Read(read =>
                        read.Action("GetManufacturers", "Home");

Lastly we can code our controller: HomeController.cs

namespace Part2_AutoComplete.Web.Controllers {
    public class HomeController : Controller {
        public ActionResult Index() {
            return View(new List<Manufacturer> {new Manufacturer {Id = 1, Name = "Aston Martin"}});
        public JsonResult GetManufacturers() {
            string searchValue = Request.Params["filter[filters][0][value]"];
            IList<Manufacturer> manufacturers = BuildManufacturersList().Where(x => x.Name.StartsWith(searchValue, StringComparison.InvariantCultureIgnoreCase)).ToList();
            return Json(manufacturers, JsonRequestBehavior.AllowGet);
        private IEnumerable<Manufacturer> BuildManufacturersList() {
            IList<Manufacturer> manufacturers = new List<Manufacturer>();
            manufacturers.Add(new Manufacturer {Id = 1, Name = "Aston Martin"});
            manufacturers.Add(new Manufacturer {Id = 2, Name = "Audi"});
            manufacturers.Add(new Manufacturer {Id = 3, Name = "Buggati"});
            manufacturers.Add(new Manufacturer {Id = 4, Name = "BMW"});
            manufacturers.Add(new Manufacturer {Id = 5, Name = "Chevrolet"});
            manufacturers.Add(new Manufacturer {Id = 6, Name = "Ferrari"});
            manufacturers.Add(new Manufacturer {Id = 7, Name = "Ford"});
            manufacturers.Add(new Manufacturer {Id = 8, Name = "Lamborghini"});
            manufacturers.Add(new Manufacturer {Id = 9, Name = "Mazda"});
            manufacturers.Add(new Manufacturer {Id = 10, Name = "McLaren"});
            manufacturers.Add(new Manufacturer {Id = 11, Name = "Mercedes Benz"});
            manufacturers.Add(new Manufacturer {Id = 12, Name = "Porsche"});
            return manufacturers;

That’s it.  Now that we are caught up with the transition to Kendo UI for ASP.NET MVC in the next post we can move on to something fresh and new…and Kendo UI certainly has a lot to offer in that area!

The code is available on GitHub.

posted on Monday, June 25, 2012 7:37:36 AM (Central Daylight Time, UTC-05:00)  #    Comments [2]
# Tuesday, June 19, 2012

Back in April I started a series of posts related to using Kendo UI in ASP.NET MVC.  Last month the Kendo team released the first beta of Kendo UI for ASP.NET MVC.  So, long story short the blog posts on Kendo UI will continue but from this point forward they will move from implementing Kendo UI proper in ASP.NET MVC to using Kendo UI for ASP.NET MVC.

Kendo UI for ASP.NET MVC includes the complete Kendo UI suite (Web, Mobile, DataViz) plus a set .NET wrappers to be used with ASP.NET MVC that leverage exciting features of MVC such as data annotations, editor/display templates and validation.  Those of you still using the WebForms view engine are safe,  the wrappers work in both the Razor view engine and the WebForms view engine.

To get started download the Kendo UI for ASP.NET MVC bits and install them.  The bits include, what I would call, the Kendo UI core features plus all the ASP.NET MVC specific features so there is no need install both Kendo UI and Kendo UI for ASP.NET MVC.  If you already have Kendo UI core installed, don’t worry, the installer will adjust accordingly.

Once installed pull up the install location, for me it is “C:\Program Files (x86)\Telerik\Kendo UI for ASP.NET MVC Q2 2012 BETA”, and play around with the example projects by running “\Examples\StartExamples.exe”.

Now…let’s get it up and running in an ASP.NET MVC project.

NOTE: The Kendo UI for ASP.NET MVC documentation states that both MVC 3 and MVC 4 are supported even though the actual Kendo.MVC.dll resides in the “Mvc3” directory.

  1. Create a new ASP.NET MVC 3 or 4 project
  2. Add a reference to: [Kendo UI Directory]\Binaries\Mvc3\Kendo.Mvc.dll
  3. Copy the contents of [Kendo UI Directory]\Scripts to the Scripts folder of your MVC project
  4. Copy the contents of [Kendo UI Directory]\Content to the Content folder of your MVC project
  5. Reference the Kendo UI scripts and and CSS files in your layout page.
    *Note: If your using ASP.NET MVC 4 I suggest creating a bundler package

    <link rel="stylesheet" href="@Url.Content("~/Content/kendo.common.min.css")">
    <link rel="stylesheet" href="@Url.Content("~/Content/kendo.default.min.css")">
    <script src="@Url.Content("~/Scripts/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.web.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script>
  6. Add a reference to the Kendu.Mvc.UI namespace to the <namespaces> section of the web.config to allow your views to know about the Kendo HTML Helper extensions.
    <add namespace="Kendo.Mvc.UI"/>
  7. Let’s test it out.  Open up Index.cshtml and create a Kendo UI control using the new HTML Helpers.



As with the previous parts of the series the code is available on GitHub.

posted on Tuesday, June 19, 2012 11:15:53 AM (Central Daylight Time, UTC-05:00)  #    Comments [6]