Archives for December 2012

Create Asynchronous HTTP Handler in ASP.NET 4.5

You now have the ability to create HTTP handlers that is not new to ASP.NET. But ASP.NET 4.5 makes it easy to create asynchronous HTTP handlers with async/await keywords and tast. This article will explain how an asynchronous HTTP handler can be created using ASP.NET 4.5 web aplication. The article will explain how to create HTTP handlers in ASP.NET, understand how asynchronous HTTP handlers are created in one or more web forms, and how you can use HTTP handler in a web form.

With ASP.NET 4.5, you can create asynchronous handlers easily. Asynchronous HTTP handler is a class which inherits from the HttpTaskAsyncHandler base class.

Read the rest of the article here:

How to Use NUnit with Visual Studio Unit Test Projects

Nunit Procedure imageWhen you use Visual Studio 2012, the default Unit Test projects uses MS-Test, the testing framework of Microsoft. However, you can use third-party applications such as NUni, xUnit.NET, and MbUnit as your Unit Test Project. This will allow you to write unit tests using any testing framework of your choice but still use Visual Studio IDE to run tests.

This article explains Unit Test Project with NUnit, how to create a unit test project in Visual Studio 2012, install the Nunit adapter to act as a bridge between Visual Studio and NUnit framework, and ue NUnit within the Unit Test Project.


Read the rest of the tutorial here:

HTTP Request in ISS That Every Developer Should Know

The lifecycle of an ASP.NET application usually beings when a request is sent by a browser to the web server. If you are an ASP.NET developer and wants to create modules or handlers, you need to understand the HTTP Request Lifecycle in ISS. This article will give you an idea of the order of the events fired in the IIS pipeline.

In IIS 6.0, there are two request processing pipelines – One for native-code ISAPI filters and the other for managed applications, like for example ASP.NET. In IIS 7.0, there is a unified request processing pipeline for all request. The runtime is integrated with th web server and IIS is configured to work in Classic Mode instead of Integrated mode but behaves like IIS 6.

Read the rest of the article here:

New Coding Guidelines for C# Have Been Published

csharp imageAfter the final release of Visual Studio 2012, it’s about time to update the C# coding guidelines. This coding guideline is for C# 3.0, 4.0, and 5.0. Major improvements include getting rid of the term identifier, applying the correct usage of arguments and parameters, adding more cross-references between guidelines, and adding links to relevant articles.

All code snippets to Consolas has also changed; thus reducing line spacing a bit, changed the accent color to allow the new version to stand out from previous versions.

Read the rest of the guideline here:

How to Use RavenDB in .NET Applications

Web applications usually store data in RDBMS like SQL Server. Sometimes you need more than relational data in an application. If your application need to handle other tasks than the traditional row-column format, you might need RavenDB.

RavenDB is a no-SQL document database which stores data in JSON format. The RavenDB client API allows you to interact with the data store from your ASP.NET application. With RavenDB, you can store data that can’t be categorized as relational but needs data manipulation opeations like add, update, and delete.


Read the rest of the tutorial here:

How to Fix Model Binding Issue of ASP.NET MVC and Web API

There is an important issue/bug in ASP.NET MVC4 and ASP.NET MVC web API. The isue is present in System.Web.PrefixContainer class that is both used by MVC and Web API. If you upgraded your application to ASP.NET MVC 4, have a look at this issue and see what you can do to fix it.

Just add this line in your Application_Start method after you download the file (link below):


2.// For fixing only in MVC call this
4.// For fixing only in Web API call this

Its just a small issue but can cause drastic change to your application.


Read the rest here:

How to Find Null or Empty Values and Replace it With Other Values

If you or one of your team has created a database that have empty values, it can sometimes be annoying to fix since you have to manually look for it or wait for an error to occur then flag and fix it. However, do yu know that you can find null or empty values automatically? This article will explain how you can find null values and replace it with any value you like. This article will explain how it can be done using C#, and VB.NET and elaborate how you can find and replace these values.

Read the rest of the tutorial here:

How to Protect your ASP.NET Web API using OAuth2 and Windows Azure

A lot of applications nowadays uses Application Programming Interface or API that can be use on any device like a web browser in a smartphone. As a developer, you need API to expose data and services to third parties. Having an API will give you the benefits of reaching more users, all you need to do is expose the API and let the people know about it. This article will discuss how to build an API using ASP.NET, what you need to know about OAuth2 and how you can se Windows Azure Access Control service to protect your Web API.

Windows Azure Access Control

Read the rest of the tutorial here:

How to Add Your Own JQuery Custom Selector

This article will explain how you can add your own JQuery custom selector. Why JQuery? Its because it supports a large number of selectors defined by the CSS3 Selectors Draft standard. It also contains pseudo classes which simplifies your task a lot. The best part about JQuery is that it lets you create and define your own custom selectors easily. In this article, we’ll create a program that will identify all mailto: links. This is a great way to identify links that points to an email and also, if you want to simplify other email task, you can do that too.

Read the rest of the tutorial here:

How to Add Automatic Exception Reporting To Your .NET Software

Its not a good software if it does not come with bugs. It is crucial that when an error occurs on the end-user, you’ll get to know more about it so you can take immediate action. With automatic exception reporting, you can simplify the way users can report bugs to you. At the same time, you can gather enough useful information which you can use to resolve the problem quickly and easily. Automatic Error Reporting can improve customer satisfaction which can also help in improving the sales of your software.

Automatic Exception Reporting is definitely a must if you want to increase customer response and improve sales.

Here’s how to do it: