I have an asp.net listview control with a asp:button in its itemtemplate. I want to open Colorbox when it is clicked and certain conditions satisfied (that is why I have trouble with calling onclientclick) and the Colorbox will show an iframe.
I tried many diffrent ways and googled alot but none of the answers were useful to me because all of them were suggesting onclientclick event instead on onclick.
I’m using a code like below to open an href link in Colorbox modal dialog:
<script>
$(document).ready(function () {
$(".ajax").colorbox();
$(".iframe").colorbox({ iframe: true,
width: "50%", height: "500px" });
});
</script>
But I can’t make it work from code-behind inside a itemcommand event of an asp.net listview.
Can you please suggest a solution?
Here is what I came into finally: