Dynamic Javascript
<p>I have a situation where I am trying to create a update / delete panel.  I currently have worked in the delete panel and decided I wanted to use the same controls for the update panel. The only way I can see this working is if the confirmation button can pick up which button was pressed.  I can not seem to figure out how to do this.  Is there a way to do this without creating a whole new popup menu with different set of buttons and all?</p>

<p>// Note that this is unfinished code and I am still experimenting with the code, so if anything is not clear to you just ask and I will try to explain.</p>

<p>javascript</p>

<pre><code>//execute popup
function popup() {
    $("#popupbg").animate({ opacity: ".8" });
    $("#delete, #update").click(
    function() {
        $("#popupbg, #popupbgitembg").show('fast')
    });
}
//execute popup cancel
function popupcancel() {
     $("#popupbg, #popupbgitembg").hide('medium');
}
//execute popup delete
    function popupdel() {
        $('execdelete').click();
            var button = document.getElementById("&lt;%= execdelete.ClientID %&gt;");
            button.click();
        $("#popupbg, #popupbgitembg").hide('medium');
    }
</code></pre>

<p>HTML (popupbg is the background)</p>

<pre><code>&lt;div id="popupbg"&gt; 
&lt;/div&gt; 
&lt;div id="popupbgitembg"&gt;
&lt;ul class="popupbgitems"&gt;
        &lt;li id="lidelete" visible="false"&gt;
            &lt;asp:Label ID="lblpopup" runat="server" &gt;&lt;/asp:Label&gt;
            Are you sure you want to delete?
        &lt;/li&gt; 
        &lt;li&gt;&lt;/li&gt; 
        &lt;li&gt;
            &lt;asp:Button ID="execdelete" runat="server" CssClass="invisible" OnClick="delSysGLDepts" /&gt;
            &lt;asp:Button ID="execupdate" runat="server" CssClass="invisible" OnClick="updateSysGLDepts" /&gt;
            &lt;asp:Button ID="butdelete" runat="server" Text="Yes" Width="70px" OnClientClick="javascript:scroll;popupdel();" Font-Size="11.5px"/&gt;
            &lt;asp:Button ID="butcancel" runat="server" Text="No" Width="70px" OnClientClick="javascript:popupcancel();" Font-Size="11.5px"/&gt;

        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;    

&lt;li&gt;&lt;asp:Button ID="update" Text="Update" style="font-size:11px"  runat="server"/&gt;
                        &lt;asp:Button ID="delete" Text="Delete" style="font-size:11px" OnClientClick="javascript:popup('delete');" runat="server"/&gt;

                   &lt;/li&gt;
</code></pre>
