ASP.NET

12345678910...Last
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
Displaying Model State Errors Inside GridView Columns
ASP.NET 4.5 web forms support model binding features. Additionally they can make use of model validation using data annotation validators. The validation errors thrown by data annotation validators can be easily displayed in a web form using ValiationSummary control. While this arrangement works great, at times you want something customized. This article shows how model errors can be displayed inside a GridView column. You can use similar technique for other databound controls such as DetailsView and FormView.
Posted On : 07 Aug 2013
Customizing CreateUserWizard control to show only Sign Up step
Recently a reader asked - Can CreateUserWizard control be customized to show a predefined Security Questions instead of allowing user to enter his own question? Can CreateUserWizard control be configured such that it shows only one step (Sign Up)? Can the completion step be skipped altogether?This short post is an attempt to answer these questions.
Posted On : 31 Jul 2013
12345678910...Last