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?
// 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.
javascript
//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("<%= execdelete.ClientID %>");
button.click();
$("#popupbg, #popupbgitembg").hide('medium');
}
HTML (popupbg is the background)
<div id="popupbg">
</div>
<div id="popupbgitembg">
<ul class="popupbgitems">
<li id="lidelete" visible="false">
<asp:Label ID="lblpopup" runat="server" ></asp:Label>
Are you sure you want to delete?
</li>
<li></li>
<li>
<asp:Button ID="execdelete" runat="server" CssClass="invisible" OnClick="delSysGLDepts" />
<asp:Button ID="execupdate" runat="server" CssClass="invisible" OnClick="updateSysGLDepts" />
<asp:Button ID="butdelete" runat="server" Text="Yes" Width="70px" OnClientClick="javascript:scroll;popupdel();" Font-Size="11.5px"/>
<asp:Button ID="butcancel" runat="server" Text="No" Width="70px" OnClientClick="javascript:popupcancel();" Font-Size="11.5px"/>
</li>
</ul>
</div>
<li><asp:Button ID="update" Text="Update" style="font-size:11px" runat="server"/>
<asp:Button ID="delete" Text="Delete" style="font-size:11px" OnClientClick="javascript:popup('delete');" runat="server"/>
</li>