Tuesday, November 13, 2007, 07:04
Posted by Administrator
When you want to delete an entry, when the user presses a button it would be useful to display a confirmation bo where the user can reconsider if he wants to delete the object...Posted by Administrator
When developing in asp.net you can't use the Messagebox.Show() method :p but you can use this alternative:
btn_Delete.Attributes.Add("onclick", "if(confirm('Are you sure to delete?')){}else{return false}");
the asp.net code for the button:
<asp:Button id="btn_Delete" runat="server" Text="delete" CssClass="button" onclick="btn_Delete_Click" />
When the popup messagebox is displayed and the user chooses "ok" the function btn_Delete_Click() will be executed otherwise the postback will be ignored.




( 3 / 480 )

Tom Van Gaever - Blog
Avatar






