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
Pre-existing databases can pose some difficulties for software developers using an ORM. To demonstrate ways of circumventing them, Jon Smith builds an ASP.NET MVC application with Entity Framework (EF) to provide a user interface to Microsoft's AdventureWorks sample SQL database. He shares his design approach for displaying and updating this data with real examples from the test web application he built.… Read more
If you find yourself doing routine work repeatedly in ASP.NET MVC, it is worth exploring the possibilities that come from modifying or creating Editor Templates in Visual Studio. Templates can save you a lot of time when creating views or other default content. Nick Harrison explains.… Read more
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
User Interface test automation is a tricky practice, and it's not always obvious what the benefits are. UI tests are an essential part of protecting your application's critical paths, and it's easy to start building them in the wrong way. Jim Holmes urges us to ask some pointed questions before we get started, and get start testing our UI the right way, for the right reasons.… Read more
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
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
Before developing any browser-based application, you can both accelerate and coordinate development by creating a live style guide that displays the standards for layout, colour, widgets, typography, navigation, forms and structure. As it is itself an MVC application, it can help with implementation details as well as style.… Read more
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
When we see a grid with some interesting data in it in an MVC application we, as users, expect to be able to download it as an Excel spreadsheet. If your application can't do it, it is no use telling the user that it is too difficult, because it isn't, as Nick Harrison explains.… Read more
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
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
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
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
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
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
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
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
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
By introducing R libraries into an ASP.NET MVC application, it is possible to broaden its analytical and visualization power immensely. To illustrate this, Sergei shows an example of how to use the R libraries Lattice and GoogleVis to detect poorly-performing product categories, the quantity sold and the profit from them, and estimate their demand over time.… Read more