I have a javascript file that Select a button using jQuery and check it for validation.the code is:
$(document).ready(function () {
$('#<%= btn_Insert.ClientID %>').on(click, function (event) {
if (Validate() != true) {
event.preventDefault();
}
});
function Validate() {
return (1 == 1);
});
but I can' get ClientID
for button and I get this Error:
Object doesn't support this property or method
where is my mistake?How I can get Client ID for a server side Button?
thanks
EDIT 1)
When I add script in head
part of page it works but when I write it to a JS file and add reference to it in head
part it does not work