user3653166
user3653166

Reputation: 23

How to show form data with confirm and cancel button before saving data in data base?

How is it possible ? I have used ASP.Net text box and label controls.

Many Thanks

Upvotes: 0

Views: 498

Answers (1)

Tummala Krishna Kishore
Tummala Krishna Kishore

Reputation: 8271

On save Button try to give OnClientClick

aspx Save button

   <asp:Button ID="btnsave" Text="Save" runat="server" OnClientClick="javascript: return test()" OnClick="serversave_click"></asp:Button>

Javascript:

function test() {
var empText = document.getElementById("<%=txtname.ClientID%>").value;
            if (confirm('Are You Certain to save this Name:'+ empText + '?')) { 
                return true;
            }
            else {
                return false;
            }

        }

Upvotes: 1

Related Questions