Hi Mann,
1. Use ClientIDMode property in ASP.Net to keep the ID of an element as specified during Design Time -
<asp:panel id="Panel1" runat="server" clientidmode="static">
<asp:imagebutton id="ImageButton2" clientidmode="static" runat="server" ....="">
</asp:imagebutton></asp:panel>
2. Write javascript to hide the panel as -
<script type="text/javascript">
$(document).ready(function(){
$('#Imagebutton2').click(function(e) {
$('#Panel1').hide();
e.preventDefault();
});
});
</script>
3. If you are using .Net < 4.0 you can also use attribute selector to perform the same, but with some own limitations like no id should be ending with the same -
<script type="text/javascript">
$(document).ready(function(){
$('[id$="Imagebutton2"]').click(function(e) {
$('[id$="Panel1"]').hide();
e.preventDefault();
});
});
</script>
I hope this helps
Thanks