Home > javascript, jQuery > How to use jQuery selectors in Asp.net

How to use jQuery selectors in Asp.net

In this post,I’d like to show you how to use jQuery selector in Asp.net.

//Attribute Ends With Selector [name$="value"]
var approveRadioButton = $('input[id$="RadioButtonApprove"]');
var reasonsDropdownlist = $('select[id$="ReasonsDropDownList"]');

References:

Selectors
jQuery VSDoc

Advertisements
Categories: javascript, jQuery Tags:
  1. jerry
    May 6, 2012 at 1:19 am

    alternatively, you can do

    var approveRadioButton = $(#”RadioButtonApprove”);

    keep it simple…

    • ybbest
      May 6, 2012 at 12:39 pm

      I wish it will work in Asp.net form but it is not, the server side ID and client side ID are different when you put a server control on it.I guess it will work in asp.net MVC.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: