skip to content
  • 18 June 2013

    Five Essential Front-End Tools That Should be Used with Modern MVC Projects

    Microsoft is doing a good job in shipping standard front-end libraries with Visual Studio 2012 “ASP.NET MVC 4 Web Application” and “ASP.NET Web Forms Application” templates, they are raising the bar for the .NET web developers.

    The VS template is a good starting base, however, I have been adding the libraries of this post to every new web project, they act as a completion to the ones shipped with VS and I wanted to share them with you.

    Read the rest of this entry »

  • 23 September 2008

    How Not To Compromise Security Through ASP.NET Validators

    Security Holes in ASP.NET Validator Controls

    I have explained in The Three Steps of Building an ASP.NET Validator Control, how to build a validator control from the ground up in three easy steps and in a reusable format. I highly recommend reading it before going any further.

    Here I am discussing the common validator control security holes that might compromise your forms security when left untreated.

    Read the rest of this entry »

    Tagged under: | 1 comment
  • 22 September 2008

    The Three Steps of Building an ASP.NET Validator Control

    Credit Card Number ASP.NET Validator

    The standard ASP.NET validator controls such as the RequiredFieldValidator or the RegularExpressionValidator do not cover all validation requirements, so usually developers tend to create a CustomValidator for such scenarios.

    A major problem with the CustomValidator is reusability, as if you wanted to use the validator in another project then there would be some copying and pasting and code duplication, then you have to maintain multiple versions of the same control.

    The solution, as you have guessed from the title, is to build your own validator control when possible to promote reusability.

    In this post I will be showing you in three simple steps how to build an ASP.NET validator control and take credit card number format check to show by example. I will also be building the architecture so that your validator and other validators that you will develop in the future could be as reusable as possible.

    How to Check a Credit Card Format

    Luhn check is an algorithm that checks if a credit card number is valid (format wise), so in practice, before you even think of doing any further processing on the credit card, this check should be satisfied.

    Read the rest of this entry »

    Tagged under: | 8 comments
  • 23 April 2008

    Response.Redirect and Server.Transfer Demystified

    I still remember the old days when I first learned ASP.NET 1.0, I used to search, like other newcomers, for the differences between Response.Redirect and the Server.Transfer. I found answers such as Server.Transfer had been kept in ASP.NET for backward compatibility with ASP so the recommendation was to use Response.Redirect or that I should be using the Server.Transfer for better performance!

    The truth is every method has a completely different and important use.

    Response.Redirect : When you call this method, ASP.NET will issue HTTP headers that will instruct the browser for the new page tonavigate to and will stop processing any further ASP.NET instruction. The following code:

    Read the rest of this entry »

  • 15 February 2008

    Check Validator – An ASP.NET Validator Control

    Check Validator used with checkbox

    While some developers assume that the classical ASP.NET validators support check boxes and radio buttons, this isn’t the case! There is a logical explanation for this; there is nothing much to check, the checkbox can only be checked or unchecked so what do you want to validate?

    In some cases you might want to display an error if a check box or a radio button is unchecked, e.g. terms and conditions check box, if so, then this is the right validator for you. Read on if you are interested in the bits and pieces of how the control works or skip to the “Using The Validator” section if you are just interested in using it.

    Read the rest of this entry »

    Tagged under: | 11 comments