Developers are now spending much more time writing and debugging JavaScript, CSS, HTML templates etc. Microsoft have responded by adding better tools for front-end development into their development environment, Visual Studio. In this article Jon Smith uses a sample application to demonstrate how he converted an existing ASP.NET MVC5 application to use these new tools… Read more
The occasional problems that you can get with POST and GET are typical of the difficulties of separating any command and query operations. This separation is tricky to achieve, at least in ASP.NET MVC. Dino suggests some ways of avoiding errors and minimising the confusing warning messages.… Read more
Is it time to abandon the use of Web Forms in favour of controller methods in ASP.NET MVC? As always, the answer is 'it depends', but it is certainly a good time to make sure that your skills-set includes the use of controller methods and understanding the software design principles behind MVC. Dino Esposito explains why.… Read more
Keeping a customer facing web site up and performing well is a challenge, especially when you are still adding new features. While providing an "always on" experience for users is preferred there are times when it is easier to take the site "down for maintenance" and fix those things that are just too difficult and costly to do with the site up. Jon Smith describes his solution to a controlled "down for maintenance" approach for ASP.NET MVC sites.… Read more
Scaffolding is a great way of kick-starting model-view-controller (MVC) framework development. Visual Studio's MVC Scaffolding uses templates to generate the routine code that is common to all ASP.Net MVC builds, such as data access and Web API. It allows the developer to concentrate on what is unique to the application.… Read more
Partial views in ASP.NET MVC allow you to reuse and customise components to act like user controls. They consist of both code and markup. They are an idea that is easy to grasp but they have great potential for the more adventurous developer who is prepared to experiment. Dino Esposito explains.… Read more
Even the most experienced programmers can be caught unawares by software they've used for years without trouble. Dino Esposito explains why and how the JSON method in an ASP.NET MVC controller class suddenly started to cause an exception on a production server, and how he fixed the problem.… Read more
Implementing a single sign-on for a set of a company's business applications isn't hard if they are all new applications, especially if you use WS-Federation and and Identity server such as Thinktecture. If it is a mix of new and existing applications then it helps to sort out any problems if you first understand the technology as a whole, and appreciate how it works. Jarek shares his experiences.… Read more
As developers we always want to produce efficient code, but efficient in what - development time or overall performance? In this article Jon Smith describes how to investigate and understand performance so that you can decide how to balance these two goals. The article starts with high level performance issues and drills down to detailed code tuning using examples taken from real applications.… Read more
ASP.NET MVC provides a way of providing declarative validation of user inputs. It removes a lot of the tedium of this important task. Nick Harrison explains how to do it, and also points out why it is so important to provide input validation… Read more
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
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
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
Website visitors will have come to expect to be able to use OAuth authentication, rather than require yet another ID and password. Although MVC5 provides Google, LinkedIn, Facebook or Twitter authentication, you would need to write custom authentication middleware for any other provider. Ed Charbeneau shows you how to get started.… 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