Category: C#

A brief note on the merits of using generic types over contextual types

A brief note on the merits of using generic types over contextual types

Introduction Generic types can reduce the class count in any project thus allowing easier maintenance, less mapping and more consistency. It promotes code reuse in a big way.

ServiceStack – Force file download

ServiceStack – Force file download

Making a call to ServiceStack to force a file to download.

Useful Regex (Regular Expressions)

Useful Regex (Regular Expressions)

Description JavaScript Java or C# Integer No Spaces (anywhere) /^([\d]+)$|^$/g ^([\\d]+)$|^$ Empty String or Integer No Spaces (anywhere) /^([\d]+)$/g ^([\\d]+)$ Alfa or Numeric Characters Only /^[A-Za-z0-9]+$/ ^[A-Za-z0-9]+$ Alfa or Numeric Characters Plus listed Other Chars /^[A-Za-z0-9#!]+$/ ^[A-Za-z0-9#!]+$ Matches alpha or numeric or # or !  

.NET MVC 3 Custom AJAX Error Handling

.NET MVC 3 Custom AJAX Error Handling

Custom Message From AJAX Error Handling with jQuery and MVC 3 An exception on the server-side will invoke the JavaScript AJAX error handling function. This blog will detail two methods to provide custom error handling, overriting the default. Both methods allow specific error messages to be returned to the client […]

.NET Web MVC 3 Multiple File upload limit

.NET Web MVC 3 Multiple File upload limit

There is a default limit on the file size (or total file size in the case of multiple files) of 4MB. To increase it, add (or modify) <httpRuntime maxRequestLength=”???” /> in Web.config where “???” is the number of kilo bytes to permit in any upload.