The
ID
value of a control with
runat="server"
is for server side programming only. If you need to get at the
client side ID
of the container control you'll have to do something like this:
var buttonIDSelector = "#<%= btn.ClientID %>";
$(document).ready(function () {
$(buttonIDSelector).click(function (e) {
e.preventDefault();
if (confirm("Hello World!!")) {
$(buttonIDSelector).click();
}
});
});
Cheers!
—MRB