Thoughts on .Net & Coding
.Net Articles, tutorials, reviews, code and more...
-
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.
-
Using SSL in ASP.NET Web API
While developing websites that need to deal with sensitive data, developers use authentication schemes such as ASP.NET forms authentication. Although these authentication schemes prohibit unauthorized access to web pages, the user credentials as well as data involved in the communication is sent as plain text. Since the data is being sent in unencrypted form it can be easily intercepted by malicious parties and can pose a security threat to your web application. To secure such communication the data must be encrypted and then sent over the wire. An industry standard method to achieve such a secure communication is Secure Sockets Layer or SSL. This article explains how SSL can be used in ASP.NET Web API to achieve secure data transfer.
-
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.
-
Learn new technologies efficiently
As a software developer you need to deal with the rapidly changing IT industry and keeping yourself updated with the new technologies is one of the most important skills that you need to have. Sadly the fact is many developers find this task too daunting. A common complaint is there is so much to learn and deciding the right learning path is difficult. This task is made difficult further by the fact that new skills must be acquired in a timely manner. If you are too late to upgrade your skills you face the risk of missing good opportunities.
-
Two Ways of Passing HTML5 Web Storage Data to ASP.NET
HTML5 web storage allows you to store data on the client side. However, unlike cookies this data is not passed automatically to the server with every request-response cycle. To pass the data stored in web storage to the server you need to make some programmatic arrangement. Two ways by which such a data transfer can be facilitated are hidden form field and Ajax call. This article explains both of these techniques with an example.
-
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.
-
ASP.NET Web Forms and ASP.NET MVC courses in August (Thane)
We are pleased to announce our August schedule of ASP.NET 4.5 Web Forms and ASP.NET MVC 4 courses. Intensive courses for software developers, small batches and real world examples. You may read more details here.
-
Formal classroom training is still good for you
As an IT trainer I come in contact with dozens of .NET software developers, team leaders and managers. One common area where most of them struggle is - keeping themselves updated with the latest technology. Especially so when technology is quite new to them. While for software developers it may sound like a part of their job they find this task quite hard because they need to strike a balance between available time, personal life, and ongoing project pressures.
-
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.
-
Two ways of selecting files for uploading
As you know HTML5 has native support for drag and drop operations. A part of this support also allows you to drag files from Windows explorer and drop them on to a web page element. The files can then be uploaded on the server as usual. In addition to HTML5 drag-n-drop you may want to allow users to use classic technique of file selection - displaying an open file dialog and let them select the files. If you are supporting both the types of file selection techniques you may want to hide the File Upload server control from being displayed on the form entirely because generally you will have some other element (usually a graphical element) on which the end user can drop the files.