Archives

Archives / 2013 / July
  • 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.

  • Using Tracing in ASP.NET Web API

    While debugging an ASP.NET Web API you may need to figure out how your code is being executed and you may also want to track its execution sequence. That is where tracing comes into the picture. Using tracing you can trace the flow of execution and various events happening in the Web API. You can either use the default trace writer provided with the Web API or create your own. This article shows how both of these approaches can be used.

  • Using Custom Action Names in ASP.NET Web API

    By default Web API action methods use the same HTTP method name that they are serving. For example, to deal with the HTTP GET method the Web API has the Get() action method. However, you may want to customize these action method names for the sake of better readability. There are several ways in which you can customize these action method names. This article discusses them with an example of each.

  • GridView Paging with Skip() and Take()

    Paging is one of the most commonly used features of ASP.NET GridView control. ASP.NET 4.5 model binding features allow you to bind a GridView with data returned by a custom method. This method is specified using the SelectMethod property and can make use of LINQ and Entity Framework to fetch data. Additionally, it allows you to implement custom paging. This article shows how.

  • Returning Images from ASP.NET Web API

    Sometimes you need to save and retrieve image data in SQL Server as a part of Web API functionality. A common approach is to save images as physical image files on the web server and then store the image URL in a SQL Server database. However, at times you need to store image data directly into a SQL Server database rather than the image URL. While dealing with the later scenario you need to read images from a database and then return this image data from your Web API. This article shows the steps involved in this process.