6

i have a webform on asp.net c# page

the user enters data into the form. there are textboxes and there's a treeview

when the user presses the SUBMIT button, i would like all the data to be shown to him for his confirmation. the user should have the option to continue with the submit OR to go back to the form and edit the data.

is there an all ready out of the box way to do this>? if not, what is the easiest way to implement this?

1
  • have you found any answer for this? Commented Jun 26, 2014 at 7:14

2 Answers 2

16

If it's a button web control, you can add onClientClick and a confirm javascript call.

<asp:button Id="btnSubmit" Text="Submit" 
       onClientClick=" return confirm('Are you sure?')" 
       onClick="btnSubmit_click" />
Sign up to request clarification or add additional context in comments.

3 Comments

@baia thank you i would like all the data to be shown to him for his confirmation.
@user558922 you can define a custom javascript method and formulate a message from all the filled out values and use confirm to display it. I don't think there's anything out of the box to display filled out data for confirmation.
@baia ok let me know if you stumble upon something
0

You can use a simple button and call a function which if your condition == true send your data or submit data using ajax

 <input type="button" onclick="TestBeforeSubmit();"value="">
    
    
    function TestBeforeSubmit()
           {
               if //Conditions == false)
               {
                   
               }
               else
               {
                   $.ajax({
                       type: "POST",
                       url: "//YourUrl",
                       dataType: 'json',
                       data: //YourData,
                       success: function (result)
                       {
                       },
                       error: function (result) {
                           alert("Something went wrong");
                       },
                   });
    }

2 Comments

"Try this" does not make for a good answer. You should explain how and why this solves their problem.
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.