background preloader


Facebook Twitter

MVC 2 jQuery Client-side Validation - IBloggable - implemented. Well, I watched Phil Haack’s show What's New in Microsoft ASP.NET MVC 2 and was impressed about the client-side validation (starts at 17:45) that MVC 2 offers.

MVC 2 jQuery Client-side Validation - IBloggable - implemented

I tried creating the same, but Phil does not show what .js files need to be included and also I was not able to find the source code for the application that he used. In order to find out the required JavaScript file references, I added all of the files in my application to the page and ran it. Of course it worked, but this is definitely not an optimum solution. By removing one at a time and testing the app, I’ve short-listed the following ones: 1: <script src="../.. 2: <script src="../.. 3: <script src="../.. Now, a little about the feature itself. 1: public class Book 3: [HiddenInput(DisplayValue = false)] 4: public int BookId { get; set; } jQuery Ajax uploader plugin (with progress bar!) « Steve Sanderson’s blog.

Do your web applications ever involve letting the user upload a file?

jQuery Ajax uploader plugin (with progress bar!) « Steve Sanderson’s blog

If so, how’s the end-user experience: do you show a nice progress bar during the upload, or do you just leave the user waiting for minutes, with no clue when (if ever) the upload will complete? Please show a progress bar, otherwise users will be justified in hating you. Check out this video to see one way it can work: Those of you who attended my ASP.NET MVC talk at DDD7 last weekend might recognise this To create this behaviour, I implemented a simple jQuery plugin that replaces normal <input type=”file”/> elements with funky Ajaxy asynchronous uploader widgets. Notice that it still works if the user doesn’t have JavaScript running in their browser. Download Here are all the files you need to accomplish this: Download jQuery-asyncUpload-0.1.js.

Setup instructions Uploading files via Ajax, by nature, involves setting things up both on the server and on the client. DataTables (table plug-in for jQuery) jQuery DataTables Plugin Meets C# - Zack Owens. jQuery DataTables Plugin Meets C# Over the weekend, I was doing some work on the internal CMS we use over at and I wanted to scrap my custom table implementation for a table system that would use JSON to return data rather than have the data be statically allocated on the page.

jQuery DataTables Plugin Meets C# - Zack Owens

Basically I wanted to have the ability to refresh, etc for editing purposes. My little table marker was too much code for something so simple. I’m a HUGE fan of jQuery, especially of the recent changes in jQuery 1.4. We have already made a significant investment in jQuery code for our CMS and I didn’t want to simply add another library or framework into the mix… by that I mean I didn’t want to throw in the Ext framework, which specialized in UI controls rather than general purpose JavaScript. I stumbled upon the jQuery DataTables plugin. Our friend, IQueriable How to output The DataTables plugin accepts either JSON or XML… whichever jQuery will parse.

Public class FormatedList public FormatedList() jQuery: The Write Less, Do More, JavaScript Library. Home. ASP.NET MVC jQuery AJAX Post JavaScript String Array to JsonResult as List<string> C#, jQuery, .NET, MVC, nHibernate, MySQL. Charlie Griefer: jQuery - Dynamically Adding Form Elements. You know the situation.

Charlie Griefer: jQuery - Dynamically Adding Form Elements

You have a form with ‘x’ number of text inputs. Eventually, you realize ‘x’ may not be enough for all users. But in the interest of keeping the page clean, you don’t want to arbitrarily continue to add these elements. What you really want to do is show a minimal amount initially, and then give the user the option of adding as many more (within reason) as that particular user might need. You might go about doing that by creating 100 fields and setting their CSS display attribute to “none”, while adding a slick JavaScript function to allow the user to display as many as they need. Why create any DOM elements that aren’t going to be used? First, you’ll want to see it in action.

Let’s take a look at the code first, and then break it down. The Markup Let’s look at what’s going on, starting with the form itself: Very straightforward markup. Next up is another div that holds 2 button elements, each with a unique id attribute. That’s it for our markup. Good news. LavaLamp for jQuery lovers! Hover above and feel for yourself, the nifty effect of Lava Lamp. What you just experienced is nothing but the LavaLamp menu packaged as a plugin for the amazing jQuery javascript library. I personally believe that the effect rivals that of flash – Don’t you? Especially considering the fact that it is extremely light weight.

Just so you know, it weighs just 700 bytes(minified)! Often I have noticed, that the credits are usually granted towards the end. As User Interface developers, we know that one of the first widgets our visitors use is a “Menu”. I hope you agree that a typical HTML widget consists of 3 distinct components. A semantically correct HTML markupA CSS to skin the markupAn unobstrusive javascript that gives it a purpose. MVC, Jquery, and Ajax to display object based on dropdown. Jquery: validate form with multiple checkboxes.