Click here to Skip to main content
12,956,358 members (66,369 online)
Rate this:
 
Please Sign up or sign in to vote.
I am using this Fancy box plugin to display a light box for confirm delete functionality.


function fancyConfirm(msg, callback)
     {
         var ret;
         jQuery.fancybox({
             modal: true,
             //  content: "<div style=\"margin:1px;width:240px;\">" + msg + "<div style=\"text-align:right;margin-top:10px;\"><input id=\"fancyConfirm_cancel\" style=\"margin:3px;padding:0px;\" type=\"button\" value=\"Cancel\"><input id=\"fancyConfirm_ok\" style=\"margin:3px;padding:0px;\" type=\"button\" value=\"Unfollow\"></div></div>",
             content: "<div id=\"unfollower\"><div><table class=\"light_marg\"><thead><tr><td colspan=\"2\">Unfollow Project</td></tr></thead><tbody><tr><td colspan=\"2\">Are you sure you want to unfollow this project?</td></tr><tr><td></td><td><input id=\"fancyConfirm_ok\" class=\"btn btn-primary btn-large\" type=\"button\" value=\"Unfollow\"><input id=\"fancyConfirm_cancel\" style=\"margin:3px;padding:0px;\" type=\"button\" value=\"Cancel\" class=\"btn btn-primary btn-large\"> </td></tr></tbody></table></div></div>",
             afterShow: function()
             {
                 $("#fancyConfirm_cancel").click(function()
                 {
                     ret = false;
                     jQuery.fancybox.close();
                 })
                 jQuery("#fancyConfirm_ok").click(function()
                 {
                     ret = true;
                     jQuery.fancybox.close();
                 })
             },
             afterClose: function()
             {
                 if (typeof callback == 'function')
                 {
                     callback.call(this, ret);
 
                 }
             }
 

             //              function()
             //              {
             //                  callback.call(this, ret);
             //              }
         });
 
     }
 
     function fancyConfirm_text()
     {
         var src ;
        fancyConfirm("Are you sure you want to unfollow this project?", function(ret)
         {
             alert((ret));
            // alert(src+'-'+ret);
             src= ret;
 
         });





This is my on button click code on asp.net

<asp:LinkButton ID="LnkBtnUnfollow" runat="server" CommandArgument ='<%# Eval("item_id")%>' OnClick="delete"   OnClientClick="return fancyConfirm_text(); " class="draft_link_tabs_but">Unfollow</asp:LinkButton>



So when i try to delete the particular row the page displays the light box for the confirmation i click yes/No but the page does not perform postback it is because i placed return false .
Posted 29-Jan-13 23:02pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,869
CHill60 3,550
Maciej Los 3,302
ppolymorphe 2,080
Jochen Arndt 1,973


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100