Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery for displaying div not working
    primarykey
    data
    text
    <p>I want a dialog div to appear and rest page to be greyed out. I should not be able to click anything else on page.<br> Following is the code I am using. Somehow the code is not working. Page just refreshes on click of hyperlink.<br> Can anyone help ?</p> <pre><code>&lt;script&gt; $(document).ready(function () { $("#DownloadButton").click(function (e) { ShowDialog(true); e.preventDefault(); }); $("#btnClose").click(function (e) { HideDialog(); e.preventDefault(); }); $("#btnDownload").click(function (e) { HideDialog(); e.preventDefault(); }); }); function ShowDialog(modal) { $("#overlay").show(); $("#dialog").fadeIn(310); if (modal) { $("#overlay").unbind("click"); } else { $("#overlay").click(function (e) { HideDialog(); }); } } function HideDialog() { $("#overlay").hide(); $("#dialog").fadeOut(300); } &lt;/script&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt; &lt;div id="overlay" class="web_dialog_overlay"&gt; &lt;/div&gt; &lt;div id="dialog" class="web_dialog"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Button ID="btnDownload" runat="server" Text="Download" /&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Button ID="btnClose" runat="server" Text="Close" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt; &lt;Triggers&gt; &lt;asp:PostBackTrigger ControlID="DownloadButton" /&gt; &lt;/Triggers&gt; &lt;ContentTemplate&gt; &lt;div class="BaseClass"&gt; &lt;asp:LinkButton ID="DownloadButton" runat="server"&gt;Download&lt;/asp:LinkButton&gt; &lt;/div&gt; &lt;asp:GridView&gt; &lt;/asp:GridView&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;/asp:Content&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload