Overview of OWIN and Katana
As OWIN is becoming popular and more common, it is important for ASP.NET developers to understand what OWIN and Katana are. ASP.NET Web API and ASP.NET Identity are already geared towards using these specifications. To that end this article explains what OWIN and Katana are and how they fit into the whole web development picture for ASP.NET developers. You will also develop a simple application to get a code level understanding of these features.
Posted On : 12 Jul 2014
10 Things to Keep in Mind while Developing a New ASP.NET Web Forms Application
Many developers are opting for ASP.NET MVC for their new web applications. However, this may not be always possible (reasons can be many and valid in a given context) and you might be required to use Web Forms for your new projects. In such cases novice developers have this doubt - "If I develop my project using Web Forms and later want to migrate to MVC, how difficult this task would be?". There is no single answer to this question. However, if you follow certain guidelines while developing a Web Forms project today, at later stage migrating to MVC would be less painful than otherwise. Here I have listed my top 10 recommendations in dealing with such a situation.
Posted On : 12 May 2014
Working with Facebook SDK for JavaScript
Now-a-days many websites provide Facebook integration to enhance the user experience. Features such as Facebook authentication, displaying Like or comments widgets, posting something on a user's wall are parts of this integration. The Facebook SDK for JavaScript provides functionality that can be consumed from the client side script to leverage such an integration. To that end this article shows you how to implement Facebook authentication, how to retrieve a user's details, such as user name and profile picture, and also illustrates how to post on the user's wall.
Posted On : 13 Feb 2014
Posting GridView Data to MVC Controller
Visual Studio 2013 provides a unified development environment for ASP.NET Web Forms and ASP.NET MVC applications. This unified environment is called as One ASP.NET. What it means for developers is that a single project can use Web Forms, MVC controllers and Web API. Under One ASP.NET at times the existing Web Forms may want to send and receive data to and from the MVC controllers. This article illustrates how this task can be accomplished.
Posted On : 22 Jan 2014
Generating Temporary Download URLs
Sometimes you need to generate temporary links - URLs that expire after a certain timespan - so that a resource indicated by the link can be accessed only for a specific period. The URL if accessed after the stipulated time window refuses to serve the intended resource. Although there can be various approaches to generate such temporary URLs, this article demonstrates a flexible and easy way to do so using ASP.NET routing coupled with download token generation logic.
Posted On : 18 Nov 2013
Using Validation Groups Inside ASP.NET User Controls
Validation groups allow you to validate data entry controls in groups. Server controls such as validation controls, Button and TextBox have ValidationGroup property that takes a string value. All the server controls having the same ValidationGroup value act as one validation group. Validation groups come handy in situations where you wish to validate only a small set of controls from many controls housed on a Web Form. Using validation groups is quite easy and straightforward. However, if you have a validation group inside a user control and there are more than one user control instances on a Web Form you face some problem.
Posted On : 29 Oct 2013
Using Value Providers in ASP.NET 4.5
ASP.NET 4.5 Web Forms support model binding. A part of the overall model binding features are Value Providers. A value provider grabs values from a request and binds those values with method parameters. ASP.NET provides several inbuilt value providers and also allows you to create your own. This article discusses what value providers are with examples. It also shows how a custom value provider can be created.
Posted On : 16 Sep 2013
Using HTML5 Date Input Type Inside GridView
HTML5 provides several new input types such as email, URL and Date. While using Date input type a textbox is displayed as a date-picker by browsers such as Chrome and Opera. Such a textbox uses dates in yyyy-MM-dd format (ISO format) and this formatting can lead to some problems in data controls such as GridView as discussed below.
Posted On : 26 Aug 2013
Ajax Based Polling in ASP.NET Web Forms and MVC
Recently a reader asked as to how Ajax polling can be implemented in ASP.NET applications. This short post attempts to answer that question. In the SSE and SignalR techniques mentioned earlier the server sends a notification to the client whenever some interesting event happens on the server. On the other hand Ajax base polling involves the client side code periodically checking the server for some status change.
Posted On : 20 Aug 2013
Validating Multiple Data Model Properties
In my previous article I wrote about displaying model state errors inside databound controls such as GridView. In that example we used data annotation validators to perform the validations. While data annotation validators do their job quite well they are inherently applied to only one data model property at a time. For example, the [StringLength] or [Required] attributes validate only one property under consideration. However, sometimes your validation rule involves multiple data model properties. In such cases data annotation validators won’t be of much use. Luckily there are other validation techniques that can come to your rescue.
Posted On : 14 Aug 2013