Multi-Step Input Forms in ASP.NET MVC

It is a common problem with a web page that a form is too complex to fit easily on the page. You can, of course, rely on the scrollbar, but it soon becomes a daunting and erratic process for the poor user. Wizards, that allow you to guide the user through a process, are great but take time to set up. Is there a simple solution for those occasions where there is too much data-entry for a form but a full wizard seems like overkill?… Read more

Taking Pictures from HTML

Sometimes a request from a user who doesn't appreciate the limitations of the technology can jolt you into discovering that an application feature that was, until recently, difficult to achieve is suddenly relatively easy. Dino was asked to allow the user to take photographs and associate them with an item of work. After he'd recovered from the shock, he decided that it was achievable, and now describes how he went on and did it.… Read more

Accepting Dates in Web Pages

Surely, not much could be simpler than using the HTML INPUT element? Actually, it was always a trouble for dates, what with having to check dates for validity and coping with all the languages and conventions. Now with HTML5, the 'date' type, and so many date-pickers that are either built-in or part of frameworks, it can become a complex decision about how you best deal with date input. Dino explains the issues of inputting dates into web applications.… Read more

Crossing the Site Domain with JavaScript

Browsers try to prevent a range of malicious attacks by preventing content being accessed by a web page from a different domain to the one that the page was fetched from. If you have a legitimate need to do this, it is a bad idea to disable this method of defence: Instead, there are more legitimate and safer ways of performing cross-domain JavaScript calls such as JSONP or Cross-Origin Resource Sharing, as Dino explains.… Read more

The Plain Simple Password Page Not So Simple Anymore

The requirements for the management of passwords have become far more complex over the past few years in response to the increasing sophistication of security breaches. Nowadays, you need to provide a range of features such as hashing, routine change of passwords, preventiion of repeat passwords, email confirmation, auto-generation of random passwords and password quality checks. Dino Esposito explains.… Read more

ASP.NET Core: A More Realistic Starter Kit

ASP.NET Core is a fascinating platform with many good ideas, but in its present form (RC1)there is a culture shock for experienced ASP.NET developers to experience the effort involved in porting a realistic application. There is an obvious advantage in being able to host an application on any web server, but is this enough to compensate for losing the convenience of an integrated pipeline?… Read more

Posting Form Content via JavaScript

Web-based applications run smoother if instead of using the traditional form method, they use JavaScript to post data to the server and to update the user interface after posting data: It also makes it easier to keep POST and GET actions separated. SignalR makes it even slicker; it can even update multiple pages at the same time. Is it time to use JavaScript to post data rather than posting via the browser the traditional way?… Read more

Keeping POST and GET Separated

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

Script Loading between HTTP/1.1 and HTTP/2

Web pages increasingly suffer from JavaScript-library bloat. Because it is difficult to avoid the awkward wait while these libraries load, there are some techniques for making the loading of these script files less evident to the page-load time. The introduction of HTTP/2 opens up further opportunities to defer script load or do it asynchronously in parallel. Dino explains.… Read more

Tips and Tricks about Razor Partial Views

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

So You Need to Expose JSON Endpoints

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

Monitor Server Tasks with ASP.NET SignalR and Bootstrap

Despite the fact that browsers were designed specifically to get information from the server only by requesting or 'pulling' it, developers have always yearned to be able to push data to browsers from the server. Typically, it would be to display, within a web page within the browser, the progress of a long-running task. Now ASP.NET SignalR and Bootstrap make it possible, with care. Dino explains how.… Read more

Selective Updates with ASP.NET SignalR

SignalR is great for all those tasks that one would otherwise need to rely on AJAX. However, it is much more versatile than this: it allows, for example, a server process to update users' browser windows selectively rather than broadcast to all, and can treat groups of users in different ways. Dino explains how this magic works.… Read more

Tracking Online Users with SignalR

SignalR is all about pushing notifications and data between web server and browser, but you can tap into a by-product of the work it has to do to keep track of the users who are currently online. This will provide a list of the users currently connected to a web community. SignalR has endpoints to push server events of any kind to the client, and thereby provides solutions for a number of common programming tasks.… Read more

Tracking Online Users

Sometimes, the requirements for a web application include a list of users that are currently logged-in. It would seem, at first glance, to be pretty trivial, but because few of us explicitly log out of web applications, the reality can get complicated. Even the best solution is a trade-off. Dino explains the issues and alternatives.… Read more

ASP.NET SignalR: Old-fashioned Polling, Just Done Better

A website often needs to update a page as the underlying data changes. You can, of course, just poll the server every few seconds on the browser via JavaScript, but to receive live updates from a site it is better to push data to the browser, using server-based SignalR. This uses web sockets to do this rather than browser-based polling where web sockets are supported on the browser. Dino explains how.… Read more

Join Simple Talk

Join over 200,000 Microsoft professionals, and get full, free access to technical articles, our twice-monthly Simple Talk newsletter, and free SQL tools.

Sign up