Click here to monitor SSC

Author Profile

Dino Esposito

A long-time trainer and consultant, Dino is the author of many popular books for Microsoft Press for .NET developers.including “Architecting Mobile Solutions for the Enterprise“ and “Programming ASP.NET MVC” both for Microsoft Press. CTO of Crionet, a firm specializing in Web-based and mobile solutions for sport events across Europe (http://www.crionet.com), at the moment Dino is also technical evangelist for JetBrains, where he focuses on Android and Kotlin development, and member of the team that manages WURFL—the database of mobile devices used by organizations such as Google and Facebook. Follow Dino through his blog at http://software2cents.wordpress.com or at http://twitter.com/despos. Check out Dino’s latest book “Microsoft .NET: Architecting Applications for the Enterprise”.

RWD, Mobile-first, JavaScript and Performance

The easiest way to make a responsive web application perform well is to minimize requests and the amount of data that is downloaded. The most dramatic way of doing this, for mobile applications particularly, is to download just the data you need to use. There are additional ways of doing this, such as 'Mobile first', Prioritized content, Intelligent markup and Compression, but the most important task is to minimize the data-download requirements. Read more...

Quick and Dirty Web Data-Binding

Sometimes, the sheer byzantine complexity of the typical JavaScript frameworks underlying a typical web application can give you pause for thought. If all you need is a simple way of creating a mobile-first application that involves creating simple markup templates, loading them into a DOM fragment and dynamically populating them with JSON data, then maybe a lean micro-framework like Mustache.JS would provide a better, leaner approach. Read more...

Revisiting Partial View Rendering in ASP.NET MVC

For any browser-based application, it makes sense to load into the web page just the content that is immediately required and avoid whole-page refreshes whenever possible. Ajax technology and JSON makes this partial-rendering easy. It is, however, worth considering ASP.NET's own partial-rendering techniques, returning HTML. It requires less client-logic and is quicker to implement. Read more...

The JavaScript Overload and Micro Frameworks

You can achieve a lot with HTML5 and CSS, but only if you employ JavaScript libraries as well. It used to be possible to restrict down to one or two libraries, but nowadays, the pressure is on to do more with a web page with such features as touch gestures, dynamic DOM updates or CSS switches. Is there such a thing as too much Javascript? Are we near the limits of what we can do with this technology? Read more...

Responsive Web Design: Relying on the Form-Factor

For visitors to get a good experience from your website irrespective of the device they use, you need to do more than just accommodate to the dimensions of the browser in pixels. To take it to the next level, you need to know about the device and its capabilities and characteristics. If we are facing ever-more diverse devices that can access the web, is it time to understand how to serve web-pages based on the 'form-factor'? Read more...

Responsive Web Design: The Downsides

Although Responsive Web Design (RWD) makes it possible to deliver design that is appropriate to a wide range in the dimensions of the browser-window, The designer cannot use RWD alone to adapt the UI to the actual device. It's not just the subtleties of the display device, but the way that the same volume of data must be sent to all devices; hardly suitable for an old smartphone with poor bandwidth. Read more...

Responsive Web Design: the Costs

Responsive Web Design is devised to help you render your website or web-based application appropriately on different sizes and aspect ratios of browser windows. Adopting it as a solution comes at a cost: It can't help to render a particular design on a specific device such as a model of smartphone. It also can require considerable refactoring of an existing site design, its navigation and testing. It has to be done right. Read more...

Caching: the Good, the Bad and the Hype

One of the more important aspects of the scalability of an ASP.NET site is caching. To do this effectively, one must understand the relative permanence and importance of the data that is presented to the user, and work out which of the four major aspects of caching should be used. There is always a compromise, but in most cases it is an easy compromise to make considering its effects in a heavily-loaded production system Read more...

ASP.NET Scalability: the Good, the Bad and the Hype

Scalability remains an exasperatingly vague term, even though there are well-established ways of ensuring that a web-based application reacts well to wide variations in usage. Dino cuts through the mystique to pin down what it is, what it isn't, and how to achieve it. Read more...

Shouldn't Your ASP.NET MVC Apps Support Localization?

An increasing number of applications are being designed to be configurable by the user to display content in a one of a number of alternative languages, currencies, date formats and other cultural aspects. It is better and easier to make such localization support intrinsic to the design rather than to retro-fit it. So what is the best way of doing so in ASP.NET MVC? Read more...

Handling Errors Effectively in ASP.NET MVC

ASP.NET MVC gives you more options in the way that you handle exceptions. Error handling isn't intrinsically exciting, but there are many ways of avoiding the classic yellow page of death, even getting ELMAH to manage error handling for you. Read more...

Social Login in ASP.NET MVC

It isn't every web application where one would want visitors to identify themselves via their Twitter, Facebook, Google or LinkedIn account. However, where it is essential to allow comments or other social interaction on your site, then ASP.NET MVC makes a 'social login' like this remarkably simple to do. Read more...

Mixing Web Forms and ASP.NET MVC

Just because you're using Web Forms, it doesn't mean that you are stuck in a technical time-warp. If you want to liven up a site with new features using Ajax and libraries such as jQuery, Bootstrap or Knockout.JS, then you can always integrate a Web API layer into a Web Forms application. Dino Esposito shows how to give your Web Forms application a new lease of life. Read more...

OWIN: Customizing the Web Server

OWIN and Katana are designed to provide a different way of meeting those objectives that currently require the use of NodeJS. With them, you can run extremely thin and super-optimized web server applications by cutting out what you don’t need and swapping out those parts that you wish to behave differently. Dino Esposito explains how to get started. Read more...

ASP.NET MVC Paging with OData

It is natural for the user to want to browse through data within an application. Until recently, the interfaces with data sources have been ill-equipped to support this. OData, at last, takes the legwork away with some well-considered support for the paging of data, without imposing any particular conventions on the application. Dino explains how to use it. Read more...

A Look at the Razor View Engine in ASP.NET MVC

Razor is now the dominant markup language for ASP.NET MVC applications, since it is terse and produces more readable markup than the ASPX syntax. Now with conditional nuggets and URL auto-completion, it is the obvious choice, as Dino explains. Read more...

Aspect-oriented Programming and Code Contracts in ASP.NET MVC

There are some aspects to application programming, such as logging, tracing, profiling, authentication and authorization that cut across the business objects. These are difficult to deal with in an object-oriented paradigm without resorting to code-injection, code-duplication or interdependencies. In ASP.NET MVC, you can use attributes in the form of action filters to provide a neater way of implementing these cross-cutting concerns. Read more...

Aiming for a Truly Responsive Web Experience

Responsive Web Design (RWD) is starting to take off as a lightweight way to adapt websites for different screen sizes and resolutions, but does it do enough? Dino Esposito thinks we can go further, and offer a better experience to all users, by combining RWD with a server-side approach. Read more...

Attribute Routing in Web API v2

Attribute routing solves a lot of the problems of classic ASP.NET routing, which can get ungainly when there are many route handlers, or you have several REST services. Dino shows how to enable and use attribute routing in ASP.NET MVC Read more...

Thoughts on ASP.NET MVC Authorization and Security

It is only a matter of time in developing most websites that you'll need to implement a way of restricting access to parts of the site. In MVC, the 'Authorize' attribute handles both authentication and authorization. In general, it works well, with the help of extension to handle AJAX calls elegantly, and to distinguish between unauthorized users and those who are not logged in. Read more...

Auto-completion in HTML-Based Input Forms

Are there ever times when the best practice for a GUI is to let the user type-in information using the keyboard? Of course there are, but then the users nowadays expect, when it is appropriate, to have auto-completion and suggestions that come with the search engines such as Google, and from mobile computers. The GUI must never get in the way. Dino shows how, as usual. Read more...

Modal Input Forms in ASP.NET MVC

Forms in websites have, for a long time, languished in their classic clunky pattern of browser-led 'submit' of content, using the FORM tag. As websites grow nearer to applications in their user-experience, so better is required. Dino show how to get a more sophisticated modal input form based on Twitter Bootstrap, jQuery Validate, and XmlHttpRequest (XHR). Read more...

ASP.NET MVC: Annotated for Input

With an ASP.NET MVC application of any size, there comes a time when you are faced with creating utility forms where you don't need a special form layout. One of the best ways of doing this is by using data annotations. Despite a quirk or two, it can save a lot of time. Read more...

Building a Public HTTP API for Data

The creation of a public API for data presents something of a dilemma for the developer. Web API, with its content negotiation, seems somehow cleverer than classic ASP.NET MVC, but there are complications, such as the XML schema, that suggest that there are merits in using MVC controllers for all public HTTP APIs Read more...

Multiple Views and DisplayMode Providers in ASP.NET MVC 4

Display modes in ASP.NET MVC 4 provide a neat way of separating page content from the way it is rendered on different devices. All you need to do is to define a display mode for each device, or class of devices, that you’re interested in. Read more...

ASP.NET MVC 4: What else?

Even ASP.NET MVC can be improved. Dino explains the value of templates, and makes a case for the productivity gains that could come if there was a way of making more interactive custom templates that are honed for your own particular requirements. Read more...

Route Validation and Controller Validation in ASP.NET MVC

The ASP.NET MVC controller is a good friend of web developers. There are a host of features in it that can be used to reduce the amount of coding you have to do, and to make the logic simpler. Read more...

Routing the ASP.NET Way

ASP.NET MVC is built on top of ASP.NET's HTTP handlers and ad hoc URLs. The process of routing a URL to the correct controller/action pair makes it far easier to create any website that plays a more versatile role than merely serving file-based pages. Read more...

Syntactic Sugar and the Async Pill

Asynchrony is essential for scalability and performance on the server side. Although it has always been possible to write asynchronous code, there has, up to now, been a downside: it is difficult to understand and maintain. Now, with the async/await. keywords, the whole approach is radically simplified for the programmer. Read more...

ASP.NET: Go Async or Sink

To be scalable, web applications have always had to be asynchronous, even if the programmer did not need to be particularly aware of the fact. However ASP.NET Webforms and ASP.NET MVC now to make it simpler for developers to implement HTTP handlers asynchronously. You can also start implementing asynchronous operations for potentially lengthy tasks in ASP.NET MVC. Dino explains how. Read more...

ASP.NET MVC Controllers and Conventions

Why is it that ASP.NET MVC has such strongly-enforced naming conventions? Can conventions for the default behaviour of code actually help to reduce the complexity of applications, and at what point is it wise to break conventions in application architecture. Dino investigates the issues. Read more...

Simulating Web API - JSON Formatters in ASP.NET MVC

The Web API framework is a useful tool for building RESTful ASP.NET MVC4 applications, but it's not essential. Dino Esposito demonstrates how you can use MVC3 to simulate several of the really useful web API framework features, and still maintain a nice, clean controller method. Read more...

The Three Models of ASP.NET MVC Apps

We've inherited from the original MVC pattern a rather simplistic idea of what should be in the Model. In fact, in ASP.NET MVC, there are three distinct types of model: the domain model, view model and input model. As the data behind an ASP.NET MVC application becomes more complex, the more the view model and domain model may diverge. Read more...

ASP.NET MVC: Resolve or Inject? That’s the Issue…

Classes should have dependencies only on abstract, rather then concrete, classes. To get around this, you can choose between Service Locator and Dependency Injection techniques. ASP.NET MVC uses 'Dependency Resolvers' which are Service Locators. When designing ASP.NET MVC applications it is open to you to decide whether to resolve or inject, so what are the pros and cons? Dino explains. Read more...

A Generic ASP.NET MVC Template

When you start an ASP.NET MVC project, you choose one of a number of project templates or starter kits. The ones that Visual Studio provide are very useful, but you can create your own if you want, and Dino finds that the generic one that he presents in this article works well to rapidly create MVC applications. Read more...

A Testing Perspective of Controllers and Orchestrators

The neat separation between processing and rendering in ASP.NET MVC guarantees you an application design that is inherently teastable. It doesn't guarantee that your application will be well-designed and quick to test. For that, attention to use-cases and the structure of your code is essential. Read more...

Never Mind the Controller, Here is the Orchestrator

The Model-View-Controller pattern of the ASP.NET MVC allows the separation of the business logic from the input and presentation logic. Although it permits the independent development, testing and maintenance of each component, it doesn’t guarantee clean code. Dino Esposito offers a modified approach in which an Orchestrator component helps to keep your controllers small, clean and manageable. Read more...

ASP.NET MVC Action Results and PDF Content

The Action Result in ASP.NET MVC provides a simple and versatile means of returning different types of response to the browser. Want to serve a PDF file with dynamically-generated content? Do an SEO-friendly permanent redirect? Dino shows you how simple this can be using a tailor-made ActionResult class Read more...

Why Join

Over 400,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.