I have a asp.net user control, I added a image button and then in head I am using javascript/jquery to add a button event to it, so that it will show a message box on button click, now if I look into developers tools I can see CSS is loaded but when I click on image button all happens is a page refresh, now if I try to add alert("Message"); instead of my function it does work.
I would prefer to do it in front end.
<head id="head1">
<link href="/_LAYOUTS/1033/STYLES/abc/arts/galdtor.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/_layouts/1033/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("input[id$='btnSE']").click(function() {
$('body').append("<div id='M'><span id='text'></span><br/><div id='BPB' onclick='return BPB();'><a href='' onclick='return BPB();'></a></div></div>");
});
function BPB() {
$('#M').remove();
$('#EM').remove();
return false;
}
});
</script>
</head>
then in body I got this,
<div style="margin: 0px 0px 0px 5px; float: left;">
<asp:ImageButton ID="btnSE" runat="server" ImageUrl="/_LAYOUTS/1033/IMAGES/abc/arts/gtor/ow.png" />
</div>