Entries for: Web Development

ASP.NET LISTBOX DOES NOT DISABLE

Added on 2013-02-22 Under:

With ASP.NET 4, ListBoxes no longer disable. This appears to be a bug with ASP.NET 4

According to the ASP.NET 4 Breaking Changes whitepaper (http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc256770141)

Controls that are not designed for user input (for example, the Label control) no longer render the disabled="disabled" attribute if their Enabled property is set to false (or if they inherit this setting from a container control).

That's great for label controls etc, but a ListBox (select element with the multiple attribute) is designed for user input and should support the disabled attribute.

There are a couple of options to work around this issue.

1) extend the ListBox and override the SupportsDisabledAttribute property:

public class DisabledSupportedListBox : ListBox
{
   public override bool SupportsDisabledAttribute { get { return true; } }
}

2) server side, manually add the disabled attribute:

ListBox.Attributes.Add("disabled", "disabled");

3) client side, manually add the disabled attribute:

$(function () {
    $("select.aspNetDisabled").attr('disabled', 'disabled');
});

If you're already extending the ListBox, option 1 is definitely the best bet. Otherwise, I'd go with option 2 and only use option 3 as a last resort.

DEVELOPMENT LINKS FOR 2012-11-26

Added on 2012-11-26 Under:

Hypermedia is the New REST

Understand memory leaks in JavaScript applications

Answering Baranovskiy’s JavaScript quiz

Shared-Secret Authentication

Writing Fast, Memory-Efficient JavaScript

The Web engineer's online toolbox

DEVELOPMENT LINKS FOR 2012-11-21

Added on 2012-11-21 Under:

A Backbone.js Render Method Explained for Beginners

Clojure Quickstart with Sublime Text 2

Unify client-side and server-side rendering by embedding JSON

DEVELOPMENT LINKS FOR 2012-11-13

Added on 2012-11-13 Under:

What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text

7 Python Libraries you should know about

JQuery fast button. Based on this Google whitepaper: Creating Fast Buttons for Mobile Web Applications

MOBILE ICONS

Added on 2012-02-26 Under:

Glyphish
Pro Icons: 400 Icons @ $25; Free Icons: 200 Icons w/ CC Attribution License

Android Icons
Pro Icons: 125 Icons @ $45; Free Icons: 50 Icons w/ CC Attribution License

TWG iPhone Toolbar Icons
160 Icons w/ CC Attribution-ShareAlike License

Gesture Cons
$100-$130; Free w/ CC Attribution-Non-Commerical License

Pixel Press iPhone Toolbar Icons
Free w/ CC Attribution License

tutorial9 Mono Icons
108 Icons Free w/ no licensing requirements