Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WebApplication.SendFile question
#4
SendFile works in all browsers. It is probably being blocked by a popup blocker, no?

SendFile() during Async calls is not good idea, IMO.
First: it doesn't make any difference in terms of page loading times, flicker, etc. Actually the sync event is more straightforward than the Async event.
Second: the browser "understands" a OnClick event which opens a popup window as a direct action of the user, so almost everything is allowed (including opening a popup window).
On the other hand, an async event is not a direct user action: the Async event generates a XMLHttpRequest (Ajax) to the server, which responds with JavaScript which then tries to open a popup window. This is - in general - forbidden by browsers, by default, which causes it to fail.

So, in short:

- OnClick = Sync = direct user action -> browser allows it to open popups
- OnAsyncClic = Async/Ajax = user action triggers JavaScript code -> browser doesn't allow it to open popups
Reply


Messages In This Thread
WebApplication.SendFile question - by Toni Santa - 07-31-2019, 03:50 PM
RE: WebApplication.SendFile question - by matija - 08-05-2019, 12:41 PM
RE: WebApplication.SendFile question - by Alexandre Machado - 08-18-2019, 09:34 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)