asp.net 4.0

Data annotation support in ASP.NET 4.0

MVC 3 picks up some new, very useful validation features available due to .NET 4 support. For example:

–  MVC 2’s DisplayName attribute wasn’t localizable, whereas the .NET 4 standard System.ComponentModel.DataAnnotations Display attribute is.

–  ValidationAttribute was enhanced in .NET 4 to better work with the validation context for the entire model, greatly simplifying cases …

Learn more

Razor view engine in ASP.NET 4.0

The default view engine used in MVC 2 is called Web Forms View Engine, because it uses the same ASPX/ASCX/MASTER files and syntax used in Web Forms. Razor was designed specifically as a view engine syntax. It has one main focus: code-focused templating for HTML generation.

To see the differences between two view engines two markups related to the …

Learn more

How to use Validation groups in ASP.NET 4.0

In more complex pages, you may want to perform validation separately, by using several distinct groups of controls, possibly in separate panels. ASP.NET 4.0 enables this scenario with a feature called validation groups. To create a validation group, you need to put the input controls and the CausesValidation button controls into the same logical group. You can do …

Learn more

How to use CustomValidator control in ASP.NET 4.0

You can use the CustomValidator control to execute your custom client-side and server-side validation routines. You can associate them with the control so that validation is performed automatically. If the validation fails, the Page.IsValid property is set to false, as occurs with any other validation control.

 

The client-side and server-side validation routines for the CustomValidator are declared similarly. They …

Learn more

How to use LINQ inner join clause based on a composite key

Web developer uses LINQ join clause when he/she wants to associate elements from different source sequences that have no direct relationship in the object model. For example, an electronic devices distributor might have a list of suppliers of a certain product, and a list of buyers. A join clause can be used, for example, to create a list …

Learn more

How to use LINQ inner join clause based on a simple key

Web developers use LINQ join clause when he/she wants to associate elements from different source sequences that have no direct relationship in the object model. For example, an electronic devices distributor might have a list of suppliers of a certain product, and a list of buyers. A join clause can be used, for example, to create a list …

Learn more

How to use RegularExpressionValidator control in ASP.NET 4.0

The RegularExpressionValidator is one of ASP.NET’s most powerful validation controls. It validates text by determining whether it matches a specific pattern. All regular expressions consist of two kinds of characters:

– Literals – represent a specific defined character

– Metacharacters –  characters for special use.

When you are going to use RegularExpressionValidator you should develop regular expression …

Learn more

How to create a manual validation in ASP.NET 4.0

You can create a manual validation in one of the three ways:

– Use your own code to verify values. In this case, you will not use any of the ASP.NET validation controls.

– Disable the EnableClientScript property for each validation control. This allows an invalid page to be submitted, after which you can decide what …

Learn more

How to use LINQ group clause to group results in VB.NET

Web developer can use LINQ group clause to group his/her results based on a key that he/she specifies. For example Web developer could specify that the results should be grouped by the City so that all clients from New York or San Francisco are in individual groups. In this case client.City is the key.

 

Dim qryClientsByCity = From client …

Learn more