ASP.Net Button not doing PostBack in FancyBox

Last Reply on Feb 07, 2014 04:36 AM By Amit

Posted on Feb 07, 2014 03:18 AM

I hv a webuser control which hv fancy box having asp button but when i  click on button it does't post back. how to resolve this issue below is my webusercontrol

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MessageZoom.ascx.cs" Inherits="usercontrol_MessageZoom" %>
<script type="text/javascript" src="http://www.powerpointmapsonline.com/new_demo/js/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="http://www.powerpointmapsonline.com/new_demo/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="http://www.powerpointmapsonline.com/new_demo/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.powerpointmapsonline.com/new_demo/fancybox/jquery.fancybox-1.3.4.css"
media="screen" />


 
 <div>
    <a href="#myDivID" id="fancyBoxLink">Send Message</a>

    <div style="display:none">
    <div id="myDivID">

        <div class="desc">
<h2>Send your Message</h2>
<div class="relevant_search" style="width:97%">

    		<table cellpadding="0" cellspacing="0" class="doc_box">
            <tr>
            <td colspan="2" align="right">
            <asp:Label ID="lblmessage" runat="server" style="font-weight:bold; color:Red;"></asp:Label>
            </td>
            </tr>
            	<tr>

                	<td width="13%"><img height="62" width="62" src="<%=utility.siterooturl() %>images/userimage/person.png" /></td>

                    <td ><textarea runat="server" name="rev" id="txtrev" cols="80" rows="2" class="comment_box" style="width:550px;" placeholder="Leave a message"></textarea></td>

                </tr>
                <tr>
                <td colspan="2"><br /></td>
                </tr>
                <tr>

                	<td align="right" colspan="2">
					
                    <asp:Button runat="server" ID="btnsendmessage" Text="Send Message" 
                            CssClass="continue_bnt"  
                            OnClientClick="return checklogin('Please login to post your comment');" 
                            onclick="btnsendmessage_Click" />
                            
                            <asp:Button ID="btnfaltu" runat="server" Text="faltu" />

					</td>

                </tr>


             
                


                </table></div>
</div>
         
         
    </div>
</div>




<script type="text/javascript">
    $("a#fancyBoxLink").fancybox({
        'href': '#myDivID',        
        'titleShow': false,
        'transitionIn': 'elastic',
        'transitionOut': 'elastic'
    });
</script>
    </div>

 

Posted on Feb 07, 2014 04:36 AM

 

<script>

var fancyboxInitOld = $.fancybox.init;
$.fancybox.init = function () {
fancyboxInitOld.apply(arguments);
$("#fancybox-tmp, #fancybox-loading, #fancybox-overlay, #fancybox-wrap").appendTo("form:first");
};

</script>

 

Put above code on your page it  will work.