ASP fileupload - event detection

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,591
5
0
Time find out what I am missing

Intent is to open the equivalent of FileOpen dialog
User selects the file name
Selects the Open button on the file dialog
Dialog closes

Here is the issue

At present, there is a pre-rendering event that happens when an additional control is selected. At this point, I know the dialog is closed because the pre-render has taken place.

However, I want to know when the dialog is closed. I need to run some code and enable/setup additional controls on the web page at that point that were not exposed until the File selection has been made.

Issue is mainly cosmetic formatting, but there should be some answer to this.

TIA
 

Train

Lifer
Jun 22, 2000
13,861
68
91
www.bing.com
You want a server side or client side event?

Are you still using Web Forms? I havent used them in a few years. It seems the .Net community has moved away from the concept of "events" on the server side, it was kind of a klunky mental model. Are you working on a legacy app? If not I would recommend using any of the dozen or so MVC styled frameworks. Makes it so mch easier to keep cleaner, seperated code.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
The whole idea of knowing when the dialog is closed is meaningless on the server-side. Webforms or MVC, you are getting a POST or GET from the browser, and sometime before that the user did or didn't open the dialog and specify a value for the file type input element in the form . On the client-side the file open dialog is handled by the browser when the user clicks the "browse" button next to a file type input element. If you want to know when the user closes the resulting dialog there is probably a way to catch that in javascript.