# Saturday, 01 September 2012

This week I had the pleasure of speaking at devLINK.  I did 5 sessions over the 3 day conference and had a blast networking with the other speakers and attendees.  Kudos to the devLINK staff on a job well done.

Here are the 5 sessions I did at devLINK 2012 and links to the associated slides and demos.

posted on Saturday, 01 September 2012 18:45:00 (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Thursday, 23 August 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, 23 August 2012 16:22:00 (Central Daylight Time, UTC-05:00)  #    Comments [2]
# Wednesday, 01 August 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, 01 August 2012 06:28:16 (Central Daylight Time, UTC-05:00)  #    Comments [3]
# Friday, 29 June 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(
            "~/Scripts/jquery.min.js",
            "~/Scripts/kendo.all.min.js"));
 
bundles.Add(new StyleBundle("~/Content/kendocss").Include(
            "~/Content/kendo.common.min.css",
            "~/Content/kendo.default.min.css"));

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, 29 June 2012 15:38:27 (Central Daylight Time, UTC-05:00)  #    Comments [3]
# Monday, 25 June 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";
}
 
<h2>@ViewBag.Title</h2>
 
@(Html.Kendo().AutoComplete()
    .Name("manufacturerAutoComplete")
    .DataTextField("Name")
    .BindTo(Model)
    .Suggest(true)
    .Filter(FilterType.StartsWith)
    .Placeholder("Manufacturer...")
    .DataSource(source => {
            source.Read(read =>
               {
                        read.Action("GetManufacturers", "Home");
               }).ServerFiltering(true);
    })
)

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"}});
        }
 
        [HttpGet]
        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, 25 June 2012 07:37:36 (Central Daylight Time, UTC-05:00)  #    Comments [1]