Despite reading through numerous similar questions and answers, I am still unable to find a solution to my problem. I am working on a form that allows users to select a file and choose a date for importing the file. If the selected date is before the last import period stored in the database, I want to display a confirm box to alert the user about potential data overwriting. The user can then choose to proceed with the import or cancel it.
I have attempted using the onClientClick
method of the asp:Button
control, but the confirm box pops up immediately upon clicking the submit button. I need the confirmation box to appear only after checking the last import period with server-side C#
code. I even tried storing the return value in a hidden field, but that didn't work.
I have explored solutions like the one mentioned in this thread but have encountered issues due to the use of an updatePanel
. My setup only includes a DatePicker
, a DropDownList
for selecting the client, and a hidden field if needed. Any help or suggestions for tweaking the existing code or implementing a new solution would be greatly appreciated. Thank you.