Blog Posts for: Aspnet Mvc

Communicate from an Azure WebJob to your website with SignalR

14 July 2015

Introduction Azure WebJobs are great for offloading long running tasks from you website, but sometimes you find that you may want to communicate the progress of those tasks back to the user. In this blog post I will demonstrate how you can communicate progress from an Azure WebJob back to the browser using SignalR. It is important to understand that the SignalR connection is made between the web server running the ASP.

Create test data with NBuilder and Faker

07 July 2015

For many web applications you may want to generate some initial, semi-realistic test data for your development and testing environments. Entity Framework provides a handy mechanism through which you can achieve this, namely seed data. You can read Mike Wasson’s blog post on the ASP.NET website for some background on how to use create seed data with Entity Framework Code-First migrations. The Seed mechanism is handy for populating the database, but how do you create the actual test data?

The ASP.NET Developer's guide to Bootstrap

24 March 2015

Introduction Twitter Bootstrap is one of the most widely used CSS frameworks at the moment and there is a massive supporting ecosystem in themes, components, tutorials and the likes. Since Visual Studio 2013, the standard ASP.NET project template has also been based on Twitter Bootstrap. Now, along with the popularity of Bootstrap there has also been the inevitable backlash from people complaining that also website now look the same. The framework itself has also grown quite large over time and inevitably contains a lot of excess CSS classes which you do not use in your applications.

Paging in ASP.NET Web API: Real-time ID-based Navigation

04 March 2015

Introduction The previous three posts in this series have focused on paging over a relatively static data set, such as a customer list. When working with real-time data such as a Twitter feed, where new records are constantly being added, you can run into a situation where records are either duplicated between pages, or some records are completely skipped over. Rakhitha Nimesh has written an article about this entitled Paginating Real-Time Data with Cursor Based Pagination.

Paging in ASP.NET Web API: Generating Pagination Links

25 February 2015

Introduction So far in the series we have looked in the first post at an introduction to paging in REST APIs and then looked at some specific implementations in ASP.NET Web API. In the second post I demonstrated how you could return pagination information in a simple JSON envelope, and in the third post I returned and requested all pagination information through HTTP headers. One constant so far in the previous two posts was that we would return details such as the page number, page size and number of pages in the pagination information.

Paging in ASP.NET Web API: Using HTTP Headers

18 February 2015

Introduction In the previous post I did paging using both an offset based mechanism as well as a page based mechanism and returned the result inside a JSON envelope. In this blog post I will discard the envelope and return a simple JSON array of objects while returning the paging meta information in HTTP Headers. In the second part of the blog post I will also change the Web API method so that users of the API can request a specific page and specify the page size through a HTTP headers instead of query string parameters.

Paging in ASP.NET Web API: Using a JSON Envelope

11 February 2015

Introduction In the introductory post I looked at some of the various methods which some of the popular web applications use in their APIs to implement paging. In this post I will implement one of the more basic methods, namely how to return the list of records inside an envelope which contain paging information. The end user of the API will make a request such as the following: GET customers?

Paging in ASP.NET Web API: Introduction

20 January 2015

Introduction I am starting a new series of posts on performing paging in APIs using ASP.NET Web API. Before I get going I want to introduce you to the various techniques which some of the most popular APIs use. In subsequent posts we will then look at how to implement some of these techniques using ASP.NET Web API. So here are some of the varying implementations of pagination used:

Share translations between ASP.NET MVC and AngularJS

23 July 2014

I am currently helping a friend on a project which involves a mobile application running on iOS and Android, with a backend API and supporting administration website which is developed in ASP.NET MVC and Web API. The application is targeted at an international audience and one of the requirements were that the application should support multiple languages. I am responsible for the development of all the web related software and for the administration website I am using AngularJS with ASP.

Remote Client Side Validation with FluentValidation

13 July 2014

My go-to library for model validation in .NET is Fluent Validation, and I have written a number of posts about it before. On the current project I am working we needed to do database validation which I described how to do in this blog post. This time however I needed to go one step further and not only do the database validation on the server side, but also on the client side.