简体   繁体   中英

asp.net: c#/javascript user needs to confirm before submitting

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?

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" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM