The jQuery DataTables plugin is my default option whenever I need to display tabular data on a webpage. This is a great jQuery - not to be confused with this jQuery - tool that can be applied to a standard, well-formed HTML table and takes care of all the paging, sorting etc that you may need to apply to any tabular data. It is a very versatile and easy-to-use plugin that can be easily extended with a number of readily available add-ons. It also supports theming, as you would expect from any established jQuery tool. With all of these bells …[read more]
Showing all posts tagged: 'jQuery'
A 13-post collection
The ASP.NET WebAPI is really versatile and powerful and I like to use it as much as I can when I develop for the web. I know that MVC controller methods can also process ajax requests, but I like the separation of concerns. WebAPI for REST calls and MVC for Views and the ViewModels manipulation. Note: if you still want to use MVC instead of WebAPI for your server implementation, have a read here. Recently, I had to implement a method to upload files to the server from an MVC view. I decided to use ajax and WebAPI. Once …[read more]
WebAPI is awesome. It allows .NET developers to quickly set up a public API for any data with minimal effort. WebAPI has been available for a while and with each iteration, it grows stronger and more versatile. However, there is no point in offering an API that no one can consume it. WebAPI works great straight out of the box for GET requests. However, once you start using it for POST, PUT or DELETE operations, then CORS kicks in and drops requests from hitting the server. CORS stops any cross domain requests so if your api is running at www. …[read more]
Partial views in ASP.NET MVC are great. They allow you to update only a part of the DOM without having to perform a full page refresh or a postback. Surely, there are many ways to achieve this, such as ajax and WebAPI, however, partial views have one major benefit over the other methods: Strongly-typed datamodels! Using this approach, the controller can push a nice object model back to the partial view instead of Json and we can take advantage of Razor and/or scaffolding for data presentation while enhancing the whole user experience. In this example, we will create …[read more]
One of the cool features of HTML5 is the new File API that allows the broswer to directly interact with files on the file system. Most modern browsers that support HTML5 can use this API to perform client-side only processing without the need for a round trip to the servers or the use of ajax etc. In effect the server becomes redundant and the user experience more fluent and responsive. You can still, if you need to, perform server-side processing, but if you only want to make the file contents available to the browser then you can use the code …[read more]
Working with Radio buttons and jQuery Radio buttons are one of the essential HTML elements that you can find in almost any website that contains a form for users to enter data. In this blog today we will do the following: Add radio buttons dynamically using jQuery And, get the value and text of the selected radio button using jQuery First you need a standard boiler plate html page that has a reference to the jQuery library. For this example we will use the Google jQuery CDN to pull the library on our page. At this stage, you page should …[read more]