Click here to Skip to main content
15,898,134 members

Dominic Burford - Professional Profile



Summary

Follow on Twitter LinkedIn      Blog RSS
6,554
Author
2,053
Authority
9,852
Debator
8
Editor
100
Enquirer
212
Organiser
2,954
Participant
I am a professional software engineer and technical architect with over twenty years commercial development experience with a strong focus on the design and development of web and mobile applications.

I have experience of architecting scalable, distributed, high volume web applications that are accessible from multiple devices due to their responsive web design, including architecting enterprise service-oriented solutions. I have also developed enterprise mobile applications using Xamarin and Telerik Platform.

I have extensive experience using .NET, ASP.NET, Windows and Web Services, WCF, SQL Server, LINQ and other Microsoft technologies. I am also familiar with HTML, Bootstrap, Javascript (inc. JQuery and Node.js), CSS, XML, JSON, Apache Cordova, KendoUI and many other web and mobile related technologies.

I am enthusiastic about Continuous Integration, Continuous Delivery and Application Life-cycle Management having configured such environments using CruiseControl.NET, TeamCity and Team Foundation Services. I enjoy working in Agile and Test Driven Development (TDD) environments.

Outside of work I have two beautiful daughters. I am also an avid cyclist who enjoys reading, listening to music and travelling.

 

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralReducing the surface area of the client Pin
Dominic Burford26-Jul-18 21:32
professionalDominic Burford26-Jul-18 21:32 
GeneralUnderstanding what you're doing Pin
Dominic Burford26-Jul-18 3:24
professionalDominic Burford26-Jul-18 3:24 
GeneralSetting environments in ASP.NET Core Pin
Dominic Burford16-Jul-18 21:29
professionalDominic Burford16-Jul-18 21:29 
GeneralCreating a zipped deployment for an ASP.NET Core web application Pin
Dominic Burford28-Jun-18 23:59
professionalDominic Burford28-Jun-18 23:59 
GeneralI’m turning into a Microsoft fanboy Pin
Dominic Burford8-Jun-18 5:45
professionalDominic Burford8-Jun-18 5:45 
GeneralAdding a confirmation dialog to an ASP.NET Core 2.0 form page handler Pin
Dominic Burford7-Jun-18 4:34
professionalDominic Burford7-Jun-18 4:34 
GeneralUploading a file in ASP.NET Core 2.0 Pin
Dominic Burford1-Jun-18 4:07
professionalDominic Burford1-Jun-18 4:07 
GeneralASP.NET Core 2.0 Razor Page Handlers Pin
Dominic Burford15-May-18 0:01
professionalDominic Burford15-May-18 0:01 
I have been using Razor page handlers recently in our web application to handle the interaction between client-side code and server-side code. There have previously been several ways of achieving this using AJAX. And this is still possible using ASP.NET Core 2.0 as I will demonstrate later in this article. There is also a TagHelper that allows you to invoke a page handler from within your Razor page. I will demonstrate both of these within this article.

The purpose of this article is not to give a detailed, step-by-step account of both of these methods. Instead, I will give an overview of them so you can see how they both work, then investigate them further if you want to implement them in your own application.

By way of introduction, a page handler is a page method that responds to a particular HTTP method e.g. Get, Post, Delete, Put etc. Page handler names are preceded by On. So the default page handlers include OnGet, OnPost etc. The name of the handler is appended to the default page handler name e.g. OnGetCustomer would be a page handler that is invoked to retrieve a specific customer. OnPostOrder would be used to post an order.

It is definitely worth looking at page handlers in more depth. I will assume the reader is familiar with page handlers. If this is not the case, please read up on them first. Okay, with that out of the way, let's dive into the detail of the article and describe how Razor page handlers can be used within an application.

I will start by firstly looking at the ASP.NET Core TagHelper method. This is the most straight-forward. This allows you to bind a client-side event such as a button-click to a server-side page handler. Here is a very simple page handler that you would define in the .cshtml page.

<form asp-page-handler="Customers" method="GET">
    <button class="btn btn-default">List Customers</button>
</form>
In the example above I have created a simple Razor page handler that fetches a list of customers. The name of the page handler given in the TagHelper syntax would therefore be OnGetCustomers. Here is the definition of the page handler in the .cshtml.cs file.

public void OnGetCustomers()
{
    //fetch a list of customer here!
}
ASP.NET Core 2.0 allows you to add multiple page handlers to the same page. You could therefore add page handlers for adding, editing, deleting and viewing customers all on the same page.

You can also pass parameters to page handlers. So if you wanted to fetch a specific customer you could achieve this using the following code example.

<form asp-page-handler="Customer" method="GET">
    <button class="btn btn-default">Get Customer</button>
    <input id="handler_parameter" type="hidden" name="selectedCustomerID" value="0"/>
</form>

public void OnGetCustomer(int selectedCustomerID)
{
    //fetch a specific customer here!
}
Obviously you would need to set the value of the input control to some meaningful value. In my particular case, I am setting the value when the click event of a Kendo UI TreeView is raised. In the event click for the Kendo control I am using JQuery to set the value to the ID of the currently selected item in the TreeView. Then when the user wants to perform an action on the item (edit, delete, view etc), the ID is passed to the page handler.

Here is the Keno UI TreeView click event when an item is selected.

function onDocumentViewNode(data) {
    $("#handler_parameter")[0].value = data.id;
}
It is worth noting that the name of the input control must be the same as the name of the parameter on the page handler. In the above example they are set to "selectedCustomerID". If they do not match, then nothing is passed to the page handler.

Another way to use Razor page handlers is by using AJAX. With AJAX you are able to invoke requests using GET, POST etc. These can be RESTful requests for example. With ASP.NET Core 2.0 they can also be Razor page handlers.

Here is a simple example of invoking a Razor page handler using AJAX.

$.ajax({
    type: "GET",
    url: "/Customer?handler=customer&selectedCustomerID="+ data.id,
    contentType: "application/json",
    dataType: "json",
    success: function (response) {
      //do something here
    },
    failure: function (response) {
      console.log(JSON.stringify(response));
    }
});
Razor page handlers open up massive opportunities for creating highly flexible applications. The interaction between the client-code and server-code is baked into the very fabric of the .NET Core Framework. To achieve such seamless interaction previously would have involved writing a lot of custom code, much of it probably spagetti-like or very clunky. With ASP.NET Core, interaction between the client and server is now totally seamless and extremely easy to achieve. Razor page handlers are highly flexible (you can respond to any HTTP verb) and very performant. They also lead to more cleaner code (there is far less code to write), and can be unit-tested (by separatng out the code into further layers of separation). Using them is really a no-brainer.

I use both of these methods in my web applications, and they allow me to write very flexible code. I have recently used both of them to interact with Kendo UI controls which give the application a much higher degree of responsiveness and flexibility.
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare

Home | LinkedIn | Google+ | Twitter

GeneralMocking the HttpContext Session object in ASP.NET Core 2.0 Pin
Dominic Burford30-Apr-18 4:31
professionalDominic Burford30-Apr-18 4:31 
GeneralUsing ViewComponents in ASP.NET Core 2.0 Pin
Dominic Burford16-Apr-18 22:49
professionalDominic Burford16-Apr-18 22:49 
GeneralWeb application metrics with Application Insight Part 2 Pin
Dominic Burford10-Apr-18 22:50
professionalDominic Burford10-Apr-18 22:50 
GeneralWriting flexible code in ASP.NET Core 2.0 Razor Pages Pin
Dominic Burford3-Apr-18 5:06
professionalDominic Burford3-Apr-18 5:06 
GeneralPerforming Code Coverage for .NET Core 2.0 applications Pin
Dominic Burford23-Mar-18 4:54
professionalDominic Burford23-Mar-18 4:54 
GeneralRe: Performing Code Coverage for .NET Core 2.0 applications Pin
Slacker00723-Mar-18 5:12
professionalSlacker00723-Mar-18 5:12 
GeneralRe: Performing Code Coverage for .NET Core 2.0 applications Pin
Dominic Burford23-Mar-18 5:15
professionalDominic Burford23-Mar-18 5:15 
GeneralBuilding ASP.NET Core 2.0 web applications Pin
Dominic Burford21-Mar-18 5:39
professionalDominic Burford21-Mar-18 5:39 
GeneralObtaining the authentication token returned from Azure AD B2C in ASP.NET Core 2.0 Pin
Dominic Burford16-Mar-18 2:03
professionalDominic Burford16-Mar-18 2:03 
GeneralVersioning a .NET Core 2.0 application Pin
Dominic Burford13-Mar-18 2:34
professionalDominic Burford13-Mar-18 2:34 
GeneralThe next generation technical stack Pin
Dominic Burford12-Mar-18 4:43
professionalDominic Burford12-Mar-18 4:43 
GeneralWriting flexible code Pin
Dominic Burford22-Jan-18 23:58
professionalDominic Burford22-Jan-18 23:58 
GeneralA cautionary tale of over-confidence in your own opinions Pin
Dominic Burford22-Dec-17 1:57
professionalDominic Burford22-Dec-17 1:57 
GeneralWhat lies ahead in 2018 Pin
Dominic Burford21-Dec-17 0:18
professionalDominic Burford21-Dec-17 0:18 
GeneralTemplated HTML emails using RazorEngine Pin
Dominic Burford30-Nov-17 4:49
professionalDominic Burford30-Nov-17 4:49 
GeneralSending emails using Azure Sendgrid service Pin
Dominic Burford29-Nov-17 11:18
professionalDominic Burford29-Nov-17 11:18 
GeneralBuilding native enterprise apps is (probably) the wrong approach Pin
Dominic Burford28-Nov-17 1:05
professionalDominic Burford28-Nov-17 1:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.