i have this in my content page: but i am getting null value if i try $("#ctl00_cphMaster_CloseButton").
$(document).ready(function() {
$("#ctl00_cphMaster_CloseButton").click(function() {
jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
if (r == true)
__doPostBack('CloseButton', '');
});
return false;
});
});
});
<uc1:ImageTextButton ID="CloseButton" runat="server"
ImageURL="Images/closeIcon.png"
Enabled="True" Text="Close"
CausesValidation="false" onclick="CloseButton_Click" />
UPDATE:
i have tried like this:
$("#<%= CloseButton.ClientID %>").click(function() {
jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
if (r == true)
__doPostBack('CloseButton', '');
});
return false;
});
});
when i run my page it throws me an error with this code:
$("#ctl00_cphMaster_CloseButton").click(function() {
jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
if (r == true)
__doPostBack('CloseButton', '');
});
return false;
});
it means it got the right id but why is it throwing an error complaining about null
Microsoft JScript runtime error: 'null' is null or not an object
UPDATE:
KP Suggestion:
$("#<%= CloseButton.ClientID %>").click(function() {
alert("yes");
});
});