asp.net 4.0

How to use LINQ Distinct clause in VB.NET

Web developers use optional LINQ Distinct clause when they want to receive a list of unique items. The Distinct clause ignores duplicate query results and can be applied to duplicate values for all return fields specified by the Select clause. If no Select clause is specified, the Distinct clause is applied to the range variable for the query …

Learn more

How to see the error details in ASP.NET

The ASP.NET developer can find information about custom error messages for an ASP.NET application by setting customErrors OFF from the web.config file.

<customErrors defaultRedirect=”url”              mode=”On|Off|RemoteOnly”>     <error. . ./></customErrors>

Setting the customErrors mode=”Off ” means that custom errors are disabled. The detailed ASP.NET errors are shown to the remote clients and to the …

Learn more

How to use LINQ Let clause in VB.NET

Web developers can use optional LINQ Let clause to compute values for each query result and reference them by using an alias. The alias can be used in other clauses, such as the Where clause. By using Let clause, Web developers can create a query statement that is easier to read because they can specify an alias for …

Learn more

How to download a file from the Web server in ASP.NET in VB.NET

You should use the Directory FileInfo classes to collect and present the names of the files you want to make available for download to the end user. You can display their names in a ListBox with a button to initiate the download. When the user clicks the button, stream the selected file to the browser. The …

Learn more

How to download a file from the Web server in ASP.NET in C#

You should use the Directory FileInfo classes to collect and present the names of the files you want to make available for download to the end user.  You can display their names in a ListBox with a button to initiate the download. When the user clicks the button, stream the selected file to the browser.  The next picture …

Learn more

How to use LINQ multiple joins

Web developers use LINQ join clause when they want 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 create a basic MVC 3 application with Visual Studio 2010

You can create a basic MVC 3 application, by following the next steps:

1. Begin by choosing File -> New -> Project

 

New Project selection with Visual Studio 2010

2. In the Installed Templates section on the left column of the New Project dialog, shown in the next picture select the …

Learn more

MVC 3 improvements in ASP.NET 4.0

ASP.NET MVC 3, abbreviated as MVC 3, shipped just 10 months after MVC 2 (described in the article Basic MVC 2 features), driven by the release date for Web Matrix. Its new features include:

– Expressive Views including the new Razor View Engine. For more details you can read the article Razor view engine in ASP.NET 4.0

–  .NET 4 Data …

Learn more

Advanced features in ASP.NET MVC 3

In MVC 3 you can find some big improvements in simplifying more sophisticated application-level tasks with support for dependency resolution and global action filters.

 

Dependency resolution

ASP.NET MVC 3 introduces a new concept called a dependency resolver, which greatly simplifies the use of dependency injection in your applications. This makes it easier to decouple application components, which makes them …

Learn more

Rich JavaScript support in MVC 3

ASP.NET MVC 3 adds some significant support for client-side development, following current standards for top quality JavaScript integration in the following aspects:

Unobtrusive JavaScript

MVC 3 supports unobtrusive JavaScript in two ways:

– Ajax helpers (such as Ajax.ActionLink and Ajax.BeginForm) render clean markup for the FORM tag, wiring up behavior leveraging extensible attributes (data- attributes) and jQuery.

Learn more