Well, like I said, I think a FileSystemWatcher doesn't make sense in a Web application but is more suitable in desktop or Service applications.
What do you expect to happen? Some file changes and then what? The server tries to send a new ASP file to the browser? No way, it's not going to happen.
The Web is stateless by design. What this means is that there is no continuous connection between a browser and the server. The browser requests a page, at the server that page is loaded / constructed and then sent to the client. This loading will only take a second, or maybe even less. When the page has been sent to the client, the server forgets about the client and will see the same client as an entirely new client when the next page is requested.
So in your scenario, as soon as you hit the button, the FileSystemWatcher will be created (I think; I am not even sure it's possible), the page finishes loading, goes out of scope and all objects created during the page's events will be destroyed.
A Web app is just not the right tool for what you're trying to accomplish. You're trying to saw down a tree with a screw driver ;)
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|