Khalid Abuhakmeh

ASP.NET MVC Custom Errors Are Broken... But Here Is The Fix

Expectations vs. Reality

Custom error pages are one of the last development items on the creation of an ASP.NET application. During development, we want to see the yellow screen of death early and often to ensure users don't see the error pages at all. I've personally added custom errors to many web applications, and even wrote about it in a previous post.

In . . .

Read More

July 19, 2015

Using HtmlAgilityPack To Strip All HTML Attributes

I've been working with government generated HTML this week.By the looks of it, I assume the HTML I am working with is generated and exported directly from Satan's Word Processor. Here is a small sample of what some of this html looks like.

<table style=\ "\"font-family:Times New Roman;font-size:1em;width:340px;border:1px . . .

Read More

July 08, 2015

An Explanation Of Azure Content Delivery Networks (CDN)

Based on my current understanding

I've spent part of my July 4th Holiday researching Azure Content Delivery Networks (CDN). Let's start with a simple definition of what a CDN is.

A content delivery network (CDN) is a system of distributed servers (network) that deliver webpages and other Web content to a user based on the geographic locations of the user, the origin . . .

Read More

July 05, 2015

Implementing Bootstrap 3 Remote Modal

Bootstrap 3 comes with a lot of value. The modal is an amazing JavaScript component, but comes with a warning of deprecation.

This [remote] option is deprecated since v3.3.0 and will be removed in v4. We recommend instead using client-side templating or a data binding framework, or calling jQuery.load yourself.

The remote feature still . . .

Read More

July 05, 2015

Registering ASP.NET MVC Route Constraints for Attribute Routing

Route constraints are a powerful tool when building ASP.NET MVC applications. While I rarely use route constraints, there are opportunities to use them that make perfect sense. I normally use route constraints when building simple content management systems (CMS). Let's take a look at what our routes may look like.

/{*page} /contact / . . .

Read More

June 28, 2015

A Bug with ASP.NET MVC ValueProviders and Formatting

Magic turns to Voodoo

I was working with Chad, a colleague of mine, on a simple ASP.NET MVC application, the typical CRUD kind. We were attempting to use an editor template in our project to display a DateTimeOffset object as a short date string. Every time we would submit our form, the date would go from a short string format to the full format. What the heck was . . .

Read More

June 23, 2015

Capturing ASP.NET Application Startup Exceptions

It has become common practice to perform tasks during an ASP.NET applications start up process. These tasks may include registering routes, configuring filters, wiring up third party dependencies, and so much more. Here is the default ASP.NET MVC application startup code pulled from the sample.

protected void Application_Start() {  . . .

Read More

June 21, 2015


All Categories: c#(2) home