ASP.NET 5 – Top Features

ASP.NET vNext is a new versatile framework that is compatible with Windows, Linux, or Mac OSX, with lots of new features. One of the most exciting features is that it’s open source (which Microsoft RARELY does) and available on GitHub.  Joydip Kanjilal did a great article on the top 10 features that are available in version 5 of ASP.Net on, and I’ve summarized the top 5 features below:

ASP.Net 5 feature No. 1: Cross-platform runtime
ASP.Net 5 applications can be executed on either the full .Net CLR (Common Language Runtime) or the the new cross-platform .Net Core CLR runtime engine. The full .Net CLR is the default runtime engine that can provide compatibility with legacy applications. It runs only on the Windows operating system.

The .Net Core CLR is a lean, modular, and completely self-contained runtime that can be used to build lightweight and cloud-optimized Web applications. The Core CLR is cross-platform and open source, with ports for Windows, Linux, Mac OS X, and FreeBSD in the works. In short, you will now be able to build your application on one platform and execute it on another or even on multiple platforms.

ASP.Net 5 feature No. 2: Cloud-ready deployment

Thanks to the self-contained Core runtime, which can be deployed with your app, ASP.Net 5 is ready for the cloud. Diagnostics, session state, cache, and configuration will now work seamlessly both on premise and in the cloud. Further, multiple ASP.Net 5 apps can now be deployed side by side on the same host but configured and updated separately, because they no longer must share the same runtime. With ASP.Net 5 we now have a minimalistic .Net stack that is optimized for cloud and server workloads.

ASP.Net 5 feature No. 3: Unified core framework

One of the most fascinating of the new ASP.Net 5 features is the inclusion of a unified programming model for ASP.Net MVC, ASP.Net Web API, and ASP.Net Web Pages applications. Before ASP.Net 5, the MVC, Web API, and NetWeb Pages frameworks were implemented separately and hence contained certain inconsistencies and even conflicts.

The unified programming model means you can build applications that leverage MVC, Web API, and Web Pages without the need to reconcile differences in the three frameworks. You now have only one type of a controller to handle requests that are common to MVC, Web API, and Web Pages applications. In essence, you now have a single routing framework, a single model binding framework, and a one-filter pipeline.

ASP.Net 5 feature No. 4: Host agnosticism
ASP.Net is now host agnostic. It includes a new modular HTTP request pipeline that is optimized and can be hosted on any of the following platforms:

Internet Information Services (IIS)
OWIN (Open Web Interface for .Net)
Self-hosted in a custom process
Host agnosticism is a great new feature that not only eliminates the dependencies on the legacy System.Web namespace, but boosts application responsiveness to a considerable extent.

ASP.Net 5 applications don’t talk directly to the Web server. Rather, host agnosticism is facilitated through “feature interfaces” provided by theIApplicationBuilder interface. This enables ASP.Net 5 applications to switch between hosts seamlessly.

The OWIN standard defines an interface between Web servers and Web clients or Web applications. Katana is Microsoft’s OWIN implementation that additionally incorporates some middleware components. In essence, Kestrel is a cross-platform Web server from Microsoft that can be used with ASP.Net 5.

ASP.Net 5 feature No. 5: Improved performance
The ASP.Net 5 framework incorporates an optimized, modular pipeline that allows you to plug in only the components that your application needs. This pipeline is based on OWIN standards and incorporates most of the learnings from the Katana project. This runtime is no longer dependent on the System.Web assembly, reducing the overhead involved in serving HTTP requests and hence improving application throughput.

All in all, ASP.Net 5 is a significant improvement over previous versions, allowing developers to build modern cloud-based web apps using the existing .NET framework. Designed to minimize overhead by using modular and flexible components, it’s pretty cool! And the fact that’s it’s open sourced on GitHub is a real game changer, IMO. Believe it or not, the first version of ASP.NET was released 15 years ago, and has evolved significantly since then (like the rest of the web and the frameworks used to build it). The documentation for ASP.NET 5 is straight forward and easy to understand, with many examples cited for different use cases.

Having built for the web using a variety of different frameworks, it’s great to see that ASP is continuing to evolve, and that it’s still relevant in 2016. Microsoft may have fallen off the map for some of its previous flagship products, but I’m happy to say that ASP.NET won’t be one of them.


Help! My Screen is Cracked

As an advocate of all things tech (cutting edge products, web based platforms, web development, etc.), I find Apple & their flagship iPhone product to be very interesting. Although this post is a bit of a departure from the norm, I had such a funny experience with my phone recently that I thought some of my readers might be interested.  I took a few days off from work recently to visit an old friend who lives in Cupertino, CA and catch up. As many of you know, Apple’s corporate headquarters is in Cupertino, CA, and the entire town is full of converts. Although Google’s headquarters is only a stone’s throw away in Mountain View, CA, I saw very few Android products while I was down there…. nearly all iPhones & Macbook Pros.

On the way out of the Uber from the airport, I dropped my phone on the cold cement. Since I’ve never dropped my phone before, I don’t keep a case on it, and I knew that as soon as I dropped it, I was in trouble. I knew that the screen was cracked before I even picked it up. Sure enough, I had a nice spiderweb pattern across the face of the phone… perfect.

Fortunately, the device still functioned, and I was able to get in contact with my friend and meet up. It was a rather uneventful trip from that point on, with lots of wine, good conversation, and walks down memory lane. As a nerd, I thought that it was my responsibility to at least try to repair my iPhone screen myself, so I read a few articles about the process, including one from Popular Mechanics. The author writes:

My first thought when my screen wouldn’t turn on: “What did I f*ck up?” I took the phone apart again and repeated the repair a dozen or so times. When that didn’t work, I posted about my predicament in iFixIt’s online forums. A few responses trickled in, and I chatted via email with a member of the iFixIt team. No matter what troubleshooting tip I tried, the screen still wouldn’t work. This being my first attempt at doing the repair, it was impossible to tell whether I had done something wrong or had just gotten a bad part.

After 20-plus attempts and no working screen, it was time for reinforcements. I took my phone to a Batteries+Bulbs location in San Francisco, where a tech who does frequent iPhone repairs kindly agreed to check my work. Turns out, I’d done everything correctly, but the original screen I’d gotten was faulty or had become damaged. He put on an extra screen the store had on hand, and voilà, my 5S was up and running.

Are you kidding me? The author bought the equipment (screw driver, replacement screen, etc.), repaired it herself, and when it didn’t work, she did it another 12 times? Not that my time is worth $1,000/hour, but honestly, I didn’t have the time or the patience for that. Another article on Cnet basically said the same thing: after replacing the screen himself, the author wrote that his screen had several ribbons cascading across it… he ended up giving up and getting it repaired by professionals.

I did a quick Google search for “Cupertino iPhone Repair” and found I dropped off my phone and walked around downtown Cupertino while it was being fixed. About 30 minutes later, I was on my way & back to the airport.

I hate to admit it, but I didn’t have the time or patience to replace my own cracked screen. I guess I’ll stick to ASP.NET 🙂

ASP Tutorial Lesson 9: Sessions

Sessions have been given a bit of a bad name but they are still useful if used with careful consideration.

A session deals with the time a user is visiting your site. By default, when a user visits a page on your site a new session begins and they are allocated an ID to identify them while they are visiting. When the user closes their browser or after a set amount of time (usually around 20mins) their session ends. Their session ID is stored in a cookie on the users machine. Later versions of ASP allow more flexibility, with ASP.NET even allowing the session information to be stored on another machine.

While a session is open you can store information in the servers memory for them, much like a dictionary. This is done like in the following;


According to Microsoft:

ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. HTTP is a stateless protocol. This means that a Web server treats each HTTP request for a page as an independent request. The server retains no knowledge of variable values that were used during previous requests. ASP.NET session state identifies requests from the same browser during a limited time window as a session, and provides a way to persist variable values for the duration of that session. By default, ASP.NET session state is enabled for all ASP.NET applications.

This is not to be confused with session variables.

There are problems with classic ASP sessions such as memory hogging and the information being fixed to the machine you first visit, making problems for efficient load-balancing, etc. This meant people ended up developing their own session/state management options. For smaller sites with few visitors or web farms that allow users to return to the same server this shouldn’t be as much of a problem and as I say earlier, ASP.NET has a lot more flexible options.

Here’s a great tutorial video on the difference between ViewState, SessionState and ApplicationState in


ASP Tutorial Lesson 8: Loops

Looping is an important part of programming. It allows you to perform the same operation over and over.

Following are the main loops used in ASP.

For .. Next

This loop will be familiar to anyone who has done basic programming. With this loop you can iterate a specified number of times while setting a variable to the current loop number. In the following example the code between the for and next statements would execute ten times, and would set x to be the current loop number from 1 to 10.

For x=1 to 10

next x

For each

This loop runs code for each item in a collection, setting a variable to contain the value of the current item in the collection.

For each item in array


Do .. while

This loop will iterate while the condition is met, so it is kind of like a mixture of an “if” and a loop.

do while [not] x<=>y



Questions on loops? You can always find great illustrations, tutorials, and helpful hints at


ASP Tutorial Lesson 7: Collections

If you want to store a list in ASP there are two popular ways, arrays and dictionaries.

Arrays are numbered lists. You can think of them as numbered boxes to put things in and you can get at the information by using the index, for example myArray(3) would get whatever was in “slot” three of myArray.

One thing to keep in mind is that arrays start with 0 (zero) as the first index. To find out how many pieces of information is stored in your array you can use ubound(arrayname).

Dimension an array

dim arrayName(x)

Dimension an array using a variable

dim arrayName()
redim preserve arrayName(x)

Dimensioning and Loading an array with values


See more info on variables in Tutorial 3.


A more advanced list is the dictionary. This stores information not against a number key but against a name. You access the value by using its name key, eg. starSigns(“July”) would return “Leo”.

Create a dictionary

set myDictionary=server.createObject(“Scripting.Dictionary”)

Add an item

myDictionary.Add “key”,”value”

Access an items value


Find if an item exists

if myDictionary.Exists(“key”) then …

Remove an item


Get an array of dictionary items


Get an array of dictionary keys



For more information on arrays, check out

Responsive Design

I’ve heard a lot of questions about response to design recently, so I wanted to write a quick article to address those questions. First of all: what is responsive design?

To put it simply, responsive web design is a style or framework of web design intended to provide A great user experience regardless of the device. In other words it does not matter if you are accessing a website from your phone, tablet, or a desktop computer; your experience in each case will be tailored to your device, so that it looks good and so that you can find the information that you’re looking for quickly.

What is the difference between adaptive design and responsive design?

This is where it gets a little bit complicated. In an adaptive design, the developer has implemented multiple fixed width layouts, whereas in a responsive design, they used multiple fluid grid layouts. It’s a subtle difference, but it has a large impact on the results.

responsive design

What kind of websites should use responsive design?

There’s a great quote by Jeffrey Veen that I’ve included below.

“Day by day, the number of devices, platforms,
and browsers that need to work with your site grows.
Responsive web design represents a fundamental shift
in how we’ll build websites for the decade to come.”
– Jeffrey Veen

In other words, everyone should use responsive web design! Whether you’re marketing for small businesses that need to appear up in local Google searches, multinational companies that only want to appear for a very small and targeted set of keywords, an advertising agency trying to get it’s name out there, or anything in between, you want to provided user experience to your users. Longtail Marketing, a company that provides search engine optimization and website development consulting services for local businesses, is a great example. Even though local businesses often times don’t have the budget to rebuild a custom website from scratch, they usually don’t need to. The real benefit is being visible on the Internet, rather than having a slick looking website. You can find them at

What are the benefits?

Aside from the benefits to the users themselves and the fact they’ll be able to see your content clearly on any device, there are other tangible benefits as well. Users are more likely to recommend the site that is clear and easy to navigate than one that is not. Many authorities on the web reward websites for having a good user experience and responsive or adaptive design by including them hiring their results were making an easier to share.

In Summary

The key take away here is that the web is evolving and that all businesses, regardless of their size or Jack two, should evolve with it. Turnkey website builders like Weebly and Square Space make it easier than ever to get a website that looks really good without having to hire an expensive advertising agency or development team. As mentioned above, the real value in having a website in the next 10 years will not be in its design, But rather how easy it is for users to find your web presence, navigate the website, and communicate with your brand. Good luck!


ASP Tutorial Lesson 6: Decisions

Making decisions is a key part of the function of a script. The two main methods in ASP are “IF” and “Case”.


What we are talking about here is basically “If this condition is true then do this”. The syntax is very close to this.

IF 10 > 5 THEN
response.write(“10 is more than 5”)

The condition in the above statement is the maths bit (“10 > 5”) but could just as easily be

IF name = “fred” THEN ..

These conditions have to evaluate to true, so if you want to know if something is not true then you can use “not”, as in the following example.

IF NOT name = “fred” THEN ..

Sometimes you want to do something if the condition is true and something else otherwise. We can use “ELSE” to do this.

IF this = true THEN

Multiple Choice

There is a little more we can discuss with IF but the above will give you enough flexibility for now. Another important decision making facility in ASP is the SELECT CASE.This takes a number of options a value could match plus has an ELSE to allow you to catch all other possibilities.

CASE “this”
CASE “that”


ASP Tutorial Lesson 5: Request

To get information back from a user the data needs to be transmitted from a web form, passed in the web address URL or stored in a cookie. Some information is also provided by the headers which are sent by the browser when making a page request.

These approaches are all dealt with by a built-in request object and values can be accessed using

myValue = request(“value”)

This will find a value that matches the name specified. A more robust approach is to use the seperate methods of the request object to prevent naming conflicts.

  • Request.Form for form values submitted using “POST”
  • Request.Querystring for values supplied on the URL or from a form submitted with “GET”
  • Request.Cookies for cookie values
  • Request.Servervariables for information sent in the header or internal server values

For example, take a look at the url of this page and you will see a portion says “?article=96”. Everything after the question mark is the “querystring”. We can access the article value by doing

requestedArticle = request.querystring(“article”)



ASP Tutorial Lesson 4: Dates and Times

Dates and times are important data formats for your pages. Just think of how often they are used in real world contexts. This lesson shows you how they are implemented in Classic ASP.

Here is a list of the main date and time format functions.

now returns 12/10/2001 17:10:33

date() returns 12/10/2001

time() returns 17:10:33

formatDateTime(now,vbLongDate) returns 12 October 2001

formatDateTime(now,vbShortDate) returns 12/10/2001

day(now) returns 12

weekday(now) returns 6

weekdayname(weekday(now)) returns Friday

month(now) returns 10

monthname(month(now)) returns October

year(now) returns 2001

If you want to get really complex then check out the 4guys site.


ASP Tutorial Lesson 3: Variables

This lesson deals with working with data using variables, one of the most important concepts to get to grips with when learning programming.

Variables are places where a programmer can store data in the web servers memory. This data will be kept in memory for the life of the current page and are wiped when the page has finished executing.

You can name variables using letters, numbers or underscores, but the name must begin with a letter or an underscore. Names in VBScript are not case sensitive but in other languages such as JScript they can be.


Take a look at the following statement:

annualSpend = monthSpend * 12

Pretty clear what is going on isn’t it? Anyone who has done some algebra should not have a problem working with variables.


One of the major failings of VBScript and Classic ASP is the fact that variable types are not enforced properly. ASP pretty much has one type of variable called a Variant and it can take the form of text (a ‘string’ such as “hello world” or ‘character’ such as the letter ‘A’), a number or a logical bit/boolean (true/false).

You are not forced to “declare” your variables before using them but this could get you into trouble with complex scripts. To switch the feature on you use

Option Explicit

at the top of your script.

Declaring Variables

You declare variables in VBScript using Dim, eg.

Dim myVar

This tells the server to allocate some spare memory for future use. Once your variable is declared you can fill it with data.

Using Variables

As we have already seen you can do mathematical operations on variables and set the value of a variable quite simply just by saying the variable is equal to another value. Strings require quotes around the value.

myNumber = 10
myString = “hello world”

Once a variable contains a value you can output that value. If you want to add one string to another (“concatenate”) you can use an ampersand.

myVariable = “hello” & “world”
response.write myVariable

Let’s take a look at an example.

If we take a look at the code you will see it’s really simple

As we progress through this tutorial you will see we can also do some pretty powerful things with strings (text variables) and more complex data types such as arrays and collections.