jQuery

Implementing Google's EU End User Consent Policy

calendar_today 29 July 2015 21:56

Javascript HTML CSS jQuery

The European Union introduced laws some while ago requiring web sites to obtain consent from EU visitors to allow the use of cookies. Most larger corporate sites have implemented a policy for obtaining consent - or an "implied consent" solution, but countless smaller sites and blogs like mine have not bothered. That's about to change for a number of us who are Google Adsense publishers (we carry Google adverts on our sites) because Google has introduced a new EU user consent policy which must be followed by those of us who use products like Google Adsense (and who want to continue using them). This article is a quick overview of what the policy is about, and how I implemented a quick and effective solution.

Check Duplicate User Names In ASP.NET Web Pages Sites

calendar_today 29 November 2013 15:22

AJAX jQuery ASP.NET Web Pages WebMatrix Razor

The Web Pages Starter Site template provides a useful starting point for developing a Razor Web Pages site that includes membership. But it doesn't include any mechanism for preventing duplicate user names. This article offers one solution to the problem that uses jQuery.

Posting Data With jQuery AJAX In ASP.NET Razor Web Pages

calendar_today 06 November 2013 19:38

AJAX jQuery ASP.NET Web Pages WebMatrix Razor

There have been a few questions recently about what you can post to the server using jQuery AJAX and where to find whatever you posted. This article looks at using the jQuery ajax method in ASP.NET Razor Web Pages and explores how different options have different results.

Saving jQuery Sortables In ASP.NET Razor Web Pages

calendar_today 28 October 2013 20:04

jQuery ASP.NET Web Pages WebMatrix Razor

jQuery Sortables offer a way to specify the order of a collection of items through an easy drag and drop interface. I have just been working on the next release of Web Pages CMS and am in the process of implementing Sortables for managing the display order of menu items. This article looks at how they can be used in Razor Web Pages and shows one way of saving the resulting order to a database.

Enhancing The WebGrid With Sort Arrows

calendar_today 14 December 2012 19:24

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

The Web Pages WebGrid offers sorting capability out of the box. However, it's not always obvious to the user on which column the grid data is being sorted at any one time, nor the direction in which it is being sorted. The convention is to provide arrows in the column header to act as a clear visual cue. This article looks at a three ways in which you can enhance your grids with sorting arrows.

Inline Editing With The WebGrid

calendar_today 13 November 2012 10:37

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

Unlike the Web Forms GridView control, the Web Pages WebGrid doesn't offer anything by way of inline editing capability. This article looks at one approach to solving that requirement through the addition of a sprinkling of jQuery.

WebMatrix - jQuery Cascading Dropdown Lists

calendar_today 08 September 2012 09:56

jQuery ASP.NET Web Pages WebMatrix

I have looked at cascading dropdown lists with WebMatrix previously, but the approach I featured demonstrated the use of jQuery Templates. At the time, the jQuery Templates project looked promising, but since then, the jQuery team have decided not to take them beyond beta stage. So the reason for this article is to illustrate a more "traditional" jQuery approach to managing cascading dropdown lists when developing ASP.NET Web Pages using WebMatrix.

Book Review - jQuery Mobile Web Development Essentials

calendar_today 07 August 2012 21:07

jQuery Book Review

The imminent release of Visual Studio (2012) will include jQuery Mobile as part of the ASP.NET MVC 4 Mobile application template, and some enhancements to the framework to make developing for mobile devices much easier. So it was a well-timed invitation that I received from Packt Publishing to review their latest jQuery title: jQuery Mobile Web Development Essentials.

Validation In Razor Web Pages 2

calendar_today 14 June 2012 12:47

jQuery ASP.NET Web Pages WebMatrix Razor

The new release of ASP.NET Web Pages - version 2 - doesn't include many obvious changes, but the most significant one is an enhanced Validation system. A couple of new classes have been introduced, and Web Pages validation now works with the MVC Unobtrusive jQuery validation library. This article explores the new validation system and sees what it brings to the party.

Using Knockout With Razor Web Pages In WebMatrix 2

calendar_today 09 June 2012 11:40

jQuery ASP.NET Web Pages WebMatrix Razor

Knockout is an increasingly popular JavaScript UI library. Its popularity is likely to increase among ASP.NET developers soon as it comes as part of some of the new MVC 4 site templates. This article looks at what Knockout is, what problems it is intended it solve and how to use it in an ASP.NET Razor Web Pages site built in WebMatrix.

Efficiently Displaying Hierarchical Data With The jQuery Accordion In Razor Web Pages

calendar_today 03 June 2012 10:30

jQuery ASP.NET Web Pages WebMatrix Razor

A frequent requirement is to display data hierarchically, such as products by category. This article shows how to use LINQ to Objects and the jQuery Accordion to display the result of a database query in such a fashion within Razor Web Pages.

Displaying Search Results In A WebGrid

calendar_today 27 August 2011 16:57

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

A number of people have run into problems when trying to combine a search or filter form, and a WebGrid. The main issue that arises is when paging or sorting the search result or a filtered subset of it. Here, I look at the cause of the problem and what you can do about it.

How To Maintain Scroll Position When Paging Or Sorting A WebGrid

calendar_today 23 August 2011 21:13

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This snippet is one in a series showing how to use jQuery to enhance the behaviour of a Web Pages WebGrid. This example shows how to maintain scroll position on the page when paging or sorting the WebGrid.

How To Make A WebGrid Row Clickable

calendar_today 23 August 2011 11:23

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This snippet is one in a series showing how to use jQuery to enhance the behaviour of a Web Pages WebGrid. This example shows how to make an entire row clickable so that the user is taken to another page that displays details of the selected row.

jQuery Autocomplete with Razor Web Pages and a SQL CE Database

calendar_today 16 August 2011 09:23

jQuery ASP.NET Web Pages WebMatrix Razor

There are a number of autocomplete solutions for jQuery, including the widget that comes as part of the jQuery UI library. This article looks at incorporating the jQuery UI Autocomplete widget into a Razor-based ASP.NET Web Pages site.

WebMatrix and jQuery Forms Part 2 - Editing Data

calendar_today 06 August 2011 17:33

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This article continues on from one I wrote a while ago, showing how to use jQuery to create a data entry form in conjunction with the WebGrid. The original article prompted a number of requests to show how to extend the example to provide editing functions, and now I have found some time to answer those requests.

Razor, Cascading Select Lists and jQuery Templates - A New Twist

calendar_today 04 January 2011 22:20

jQuery ASP.NET Web Pages WebMatrix Razor

jQuery Templates enable easy client-side generation of html. When combined with JSON data or other JavaScript objects, jQuery Templates provide a way to create a dynamic data-driven site without any server-side code whatsoever. However, in this article I will look at how they can be used to produce cascading select lists in a Razor Web Pages site.

Building Mobile Apps with WebMatrix and jQuery Mobile

calendar_today 12 December 2010 21:52

jQuery ASP.NET Web Pages WebMatrix Razor

jquery Mobile was launched just a month or so ago, and is designed to make it as easy to build JavaScript-enabled web applications for mobile phones as for the desktop browser. Still in Alpha, the library has a way to go, but it already offers a rather interesting experience when used as part of a mobile phone targeted web application. Here's a first look at how to use jQuery Mobile with WebMatrix to build a mobile web application.

WebMatrix - Testing the WebImage Helper With JCrop

calendar_today 17 October 2010 09:06

jQuery ASP.NET Web Pages WebMatrix

My original JCrop article which looked at cropping uploaded images in ASP.NET has proven to be the most popular coding article I've ever written, with more views and comments than any other. Revisiting JCrop in the context of Web Pages gives me the opportunity to have a look at the WebImage helper, and see how that might make uploading and cropping images easier.

WebMatrix - Working With The JSON Helper

calendar_today 15 October 2010 18:51

jQuery ASP.NET Web Pages WebMatrix Razor

Javascript Object Notation (JSON) is a data exchange format which really grew in popularity as AJAX libraries took off. It's lightweight and human readable, and is a great way of transferring data structures between the browser and the server. The JSON Helper was added in WebMatrix Beta 2, and this article looks at its main methods, and how they can be used.

WebMatrix And jQuery Forms

calendar_today 10 August 2010 17:23

jQuery ASP.NET Web Pages WebMatrix WebGrid

Even though WebMatrix is still in its first Beta, there have been a few requests in forums already for examples illustrating how to create Web Pages forms powered by AJAX. Building on previous articles, I thought I'd put together a little sample that shows how to do this to add a record to a database using jQuery. Here's how it's done.

jQuery News Scrollers and Tickers with a ListView

calendar_today 21 May 2010 21:12

ASP.NET 3.5 jQuery

The jQuery Cycle plug-in is most often used for creating image slide shows. However, it's just as easy to use to create a news scroller from a ListView. Here, I look a doing just that. I also look at an alternative jQuery plug-in (NewsTicker) that gives the effect of the classic BBC News Ticker.

jQuery Star Rating with ASP.NET MVC

calendar_today 08 September 2009 13:40

AJAX Javascript jQuery ASP.NET MVC

There are a number of jQuery star rating plugins to choose from. All have their pros and cons. For this site, I decided to implement the one from FyneWorks because it allows for split stars. Here's how I did it.

A Degradable jQuery AJAX Email Form for ASP.NET MVC

calendar_today 29 May 2009 15:58

AJAX ASP.NET 3.5 jQuery ASP.NET MVC

Pretty much every web site on the Internet features a form for users to provide feedback via email to site owners. This site is no different. Migrating to ASP.NET MVC requires a slightly different approach to that used by Web Forms development, so this article looks at one way to implement a web site contact form using the MVC framework and jQuery that degrades nicely. AJAX functionality is said to be "degradable" if a way is provided for the process to work, even though users don't have Javascript available to them.

Many ways to communicate with your database using jQuery AJAX and ASP.NET

calendar_today 04 May 2009 18:39

AJAX ASP.NET 3.5 jQuery

I've recently done a series of articles that feature calling databases via AJAX using jQuery. In pretty much all of the articles, I have used Web Services as my data access mechanism. Judging from the comments that some of the articles have attracted, this has caused a little confusion. But Web Services is just one mechanism. Page Methods and simple ASPX files are two more. And finally, as pointed out by a commenter, Benny Halperin, ASHX files are yet another option. In this article, I shall review each of these approaches.

Build your own Whois Lookup with ASP.NET and jQuery

calendar_today 14 April 2009 22:39

AJAX Javascript ASP.NET 3.5 jQuery

IP addresses can reveal a lot about your web visitors. For an ecommerce site, the owner or registrant of the visitor's IP address can be very useful information. You could paste each visitor IP address into one of the many free IP Lookup sites available, but that can be time-consuming and tedious. Or you could build your own lookup. This article shows how this can be done pretty quickly.

Lazy Loading jQuery Tabs with ASP.NET

calendar_today 02 March 2009 07:30

AJAX Javascript ASP.NET 3.5 jQuery

This article looks at efficient use of jQuery tabs when displaying data. Specifically, it covers how to lazy-load data, so that it is only accessed and displayed if the tab is clicked.

Persisting the position of jQuery Draggables in ASP.NET

calendar_today 04 February 2009 22:29

AJAX Javascript ASP.NET 3.5 jQuery

It was bound to happen - you knock up an article on jQuery draggables one day, and the next, someone like Jim ;-) comes along and asks about persisting the position of the dragged item across Postbacks, or even sessions. I suppose it's my fault - I mentioned using draggables in a previous life in the context of saving the position, so it's only fair I share how that's done.

Experimenting with jQuery Draggables and ASP.NET

calendar_today 01 February 2009 08:12

Javascript ASP.NET 3.5 jQuery

One of the keystones of modern AJAX-enabled web sites is Drag and Drop. This article looks at the current state of Draggables that form part of the jQuery UI Library.

Preventing duplicate User Names with ASP.NET and jQuery

calendar_today 24 January 2009 18:18

AJAX Javascript ASP.NET 3.5 jQuery

It's a common problem: you have a registration form, but you want to prevent user names or other values from being used more than once. You need a user-friendly way to prevent duplicate values being submitted. This is where the simplicity of jQuery excels.

Ajax with Classic ASP using jQuery

calendar_today 17 January 2009 23:13

Classic ASP VBScript AJAX Javascript jQuery

My simple article on Ajax with Classic ASP is one of the most popular on this site. So I thought it's about time I updated it to show how to use jQuery to Ajaxify a Classic ASP page. Since I did that, the jQuery version became even more popular but needed to be brought up to date. This latest version uses a couple of suggestions that have been provided by commentors to improve the code. I have also added a download which contains all the code needed to run the samples.

Cascading DropDownLists with jQuery and ASP.NET

calendar_today 13 January 2009 08:47

AJAX Javascript ASP.NET 3.5 jQuery

Cascading DropDownLists or dependent dropdowns are the signature dish for AJAX applications. I spent quite a while fiddling to try to get some to work, before stumbling across a life-saving jQuery plugin that makes working with DropDownLists on the client-side a breeze. This article shows how it all works, and makes use of the WebService I introduced in my previous jQuery article.

Handling JSON Arrays returned from ASP.NET Web Services with jQuery

calendar_today 10 January 2009 09:09

AJAX Javascript ASP.NET 3.5 jQuery ASP.NET Web Forms

There appear to be many articles showing how to use jQuery with ASP.NET Web Services around, but the vast majority of them illustrate the use of PageMethods that return a single value - typically "Hello World!" or the current date and time. Not much use in the real world, where you may more often need to call a service that returns a collection of complex objects. Here are a couple of examples that look at playing with more than just simple values.

Upload and Crop Images with jQuery, JCrop and ASP.NET

calendar_today 05 January 2009 13:54

C# AJAX Javascript ASP.NET 3.5 jQuery

I got given jQuery In Action for Christmas. By nature, I'm kind of a late adopter, and I'm already regretting this fact. jQuery has been around for some time, and I wished I had looked at it sooner. It's a fantastic library that really simplifies Javascript development, and is already attracting a goodly number of plug-ins. JCrop is one such, and while it hasn't yet reached version 1.0, it is remarkably easy to use as a web based image cropper. Here's how to put jQuery, JCrop and a FileUpload control together to allow users to upload images and crop them.