jquery dropdown selector AutoPostback

asp.net, jquery

Solution

Typically, a dropdown that is going to postback will have an onchange attribute that contains something like "__doPostBack(" though there will also be some other stuff in there.

So you could do something like the below, which I didn't test so hopefully there is no typos

$('select[onchange*="__doPostBack("]').change(...your handler for postbacking control...);
$('select:not([onchange*="__doPostBack("])').change(...your handler for non-postbacking control...);

Problem

In jQuery is there any way to distinguish between postbacking dropdowns and non-postbacking ones(ASP.NET 3.5): ``` $('select').change(function(e) { //something like this if ($(this).attr('AutoPostback') == true) { //do something here } else { //do something else } ``` Think have to call server side function from script here to determine AutoPostback.

Original source