1
Answer

How to refresh a document of the server?

goraperas

goraperas

19y
2.5k
1
How to refresh a document of the server? Hi, I have a Microsoft Word document on my server, which is modified by making certain actions in my ASP.NET web application, and I would like to show this document when the user clicks on a button. The problem is that the user always gets the initial version of the Word document, without any changes. If I close the application and open again the document I can see that it has been modified. Is there any way to refresh the document, so that the user doesn't have to close the application to see the changes? Thanks, goraperas P.D. I use javascript to open the document on a certain frame of my web page: string args = "top.frames['right'].location='url_of_my_document';"; Response.Write("");
Answers (1)
0
Vulpes

Vulpes

NA 98.3k 1.5m 11y
The main purpose of events (as implemented in .NET) is to prevent the subscribers from interfering with each other or with the event itself.

The only way a subscriber can subscribe, or unsubscribe, to an event is by using C#'s special += or -= operators. Subscribers do not know about other subscribers and cannot therefore interfere with them.

Moreover, code outside the broadcaster (i.e. the type which contains the event) is not able to access the event at all apart from via the += and -= operators or via any public method which the broadcaster may provide to indirectly fire or otherwise manipulate the event.

None of this is possible using 'ordinary' delegates (events are just a special type of delegate) which need to be public for subscribers to be able to subscribe to them in the first place. The subscriber therefore has direct access to the delegate and can view or manipulate its invocation list.