title: How can I show fancybox on click of a button (Example)
body: <p>I have a web application, and the requirements need to show jquery lightbox as a confirmation message including some information. </p>
  
  <p>After some research I found fancybox <a href="http://fancyapps.com/fancybox/#useful" rel="nofollow">FancyBox Jquery Light box</a></p>
  
  <p>I followed this step by step till I could show the required confirmation message in a fancy box, which is triggered by <code>&lt;a href="#popup" class="fancybox"&gt;Open&lt;/a&gt;</code></p>
  
  <p>I need to trigger or show the fancy box from code behind of an asp:button </p>
  
  <p>I've searched a lot and all results that I got when applied did not work.</p>
  
  <p>Can any one please show me a sample about triggering fancybox from code behind of asp button in c# and attach it here?</p>
  
  <p>that is a sample of my code:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery   /1.7/jquery.min.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="/source/jquery.fancybox.css?v=2.1.0" type="text/css" media="screen" /&gt;
  &lt;script type="text/javascript" src="/source/jquery.fancybox.pack.js?v=2.1.0"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  $(".fancybox").fancybox({
      openEffect: 'none',
      closeEffect: 'none',
      afterLoad: function () {
          this.content = this.content.html();
      }
  });
  &lt;/script&gt;
  
  
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
      &lt;a href="#test" class="fancybox"&gt;Open&lt;/a&gt;
  
      &lt;div id="test" style="display:none;width:300px;"&gt;
      &lt;table border="0" cellpadding="0" cellspacing="0"&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input id="Hello" type="text" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input id="Button1" type="button" value="Press Here" /&gt;            
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>This code is work correctly and show the fancybox after click on open link
  all my need is to show the fancybox after click on asp:button </p>
  
  <p>Thanks in advance </p>