Hi,
I have a problem to open jquery popup in codebehind using asp.net.
This is my code:
<div id="popupSharev" class="popup_block2">
<div id="Div2" class="active">
<div id="share-link1" class="share-link">
<p>
<a id="hide" href="#" title="Close" class="c-link"></a>
<h3>Hi this is popup window</h3>
<asp:Button runat="server" ID="btnUpdate" />
</p>
</div>
</div>
</div>
this is anchor tag to open to popup
<a id="imgshare" href="#?w=500" class="poplight1" rel="popupSharev">
<span><b>1.3K</b> SHARES</span>
</a>
This is my script:
<script type="text/javascript">
$('a.poplight1[href^=#]').click(function () {
var popID = $(this).attr('rel');
var popURL = $(this).attr('href');
var query = popURL.split('?');
var dim = query[1].split('&');
var popWidth = dim[0].split('=')[1];
$('#' + popID).fadeIn().css({ 'width': Number(popWidth) }).prepend('<a href="#" class="close btn_close1 c-link2"></a>');
var popMargTop = ($('#' + popID).height() + 80) / 2;
var popMargLeft = ($('#' + popID).width() + 80) / 2;
$('#' + popID).css({
'margin-top': -popMargTop,
'margin-left': -popMargLeft
});
$('body').append('<div id="fade2" style="z-index:10"></div>');
$('#fade2').css({ 'filter': 'alpha(opacity=80)' }).fadeIn();
return false;
});
$('a.poplight1[href^=#]').click(function () {
var popID = $(this).attr('rel');
var popURL = $(this).attr('href');
var query = popURL.split('?');
var dim = query[1].split('&');
var popWidth = dim[0].split('=')[1];
$('#' + popID).fadeIn().css({ 'width': Number(popWidth) }).prepend('<a href="#" class="close btn_close1 c-link2"></a>');
var popMargTop = ($('#' + popID).height() + 80) / 2;
var popMargLeft = ($('#' + popID).width() + 80) / 2;
$('#' + popID).css({
'margin-top': -popMargTop,
'margin-left': -popMargLeft
});
$('body').append('<div id="fade2" style="z-index:10"></div>');
$('#fade2').css({ 'filter': 'alpha(opacity=80)' }).fadeIn();
return false;
});
$('a.close, #fade2').live('click', function () {
$('#fade2 , .popup_block2').fadeOut(function () {
$('#fade2, a.close').remove();
});
return false;
});
function fdout() {
$('#fade2 , .popup_block2').fadeOut(function () {
$('#fade2, a.close').remove();
});
return false;
}
function fdout() {
$('#fade2').remove();
}
function HideCtrl(ctrl, timer) {
var ctryArray = ctrl.split(",");
var num = 0, arrLength = ctryArray.length;
while (num < arrLength) {
if (document.getElementById(ctryArray[num])) {
setTimeout('document.getElementById("' + ctryArray[num] + '").style.display = "none";', timer);
}
num += 1;
}
return false;
}
</script>
If I will take linkbutton and with in onclick event I want to open popup.
Please Help me......
Thank you.