title: Pause server side execution and continue based on user input
body: <p>I have a requirement where in I am processing some XML on server in a web application <br>
  Assume there is a <strong>button on a asp.net page</strong>. When the user clicks the button, I call a function say <strong>button_click() -> which in turns calls some service method to process XML.</strong> <br></p>
  
  <p>Problem scenario::<BR>
  Now lets say I am processing the XML and I am done with 50% of the processing. I notice that <strong>I have to get confirmation of user</strong> since some value in the XML is invalid. At this point I want to show a prompt to user to say yes or no ( may be a javascript prompt ) and then:<br>
  1. <strong>if the user clicks OK</strong> -> I want to continue processing the remaining 50% of the XML<br>
  2. <strong>if the user clicks NO</strong> -> I want to stop processing and display an error message.</p>
  
  <p>After lot of trial and error and my knowledge of developing web application, I felt that there is no way to do this, unless I start execution of my service again with some flags when the user clicks OK. But my colleagues are not convinced and they say there must be a way to do that and I lack the knowledge for it.  <strong>Its quiet an interesting problem</strong>.<br><br>
  **NOTE : We are actually porting an existing desktop application into web hence the problem of dialog boxes !
  <br><br>
  I request you to kindly help me regarding this experts ! Also I would like to know is there any other way to do handle such scenarios ?</p>
  
  <p>EDIT : Adding more info. <br>Actually what I mean here by XML processing is every user has some XML created by server using a WINDOWS service. When the user clicks on some button , we have to process that XML and if everything is correct, we have to call third party service and get results and update the DB. <br>What happens sometimes is, the WINDOWS service that creates the XML puts some invalid values ( we cant correct them since its not under our control ) . So, we need to get a confirmation to the user that some values are invalid and if he wants to proceed. In this way we want to be doubly sure that we are sending invalid values by the consent of user. The problem is we identify the value is invalid sometimes at the end of the XML file (we cant change this) , so we dont want to process the XMl once again ! </p>