-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to redirect or return file after the successful postback #431
Comments
We should discuss this as part of #835. |
I actually think that we should have direct support for file downloads and don't do that using a redirect. Even on a first page load, we should support downloading a file or downloading multiple files. |
Is there a way to do it without a redirect? |
By putting a piece of JS into the page :) |
Wow, I didn't know JS is that powerful! But seriously - is there a JS API that can do that? I am not aware of any other method than making a link to the file URL, or redirecting to it. Also, if there is some API that can do that, we should decide what to do with IE11, and also think about the consequences on the postback pipeline (UpdateProgress behavior etc.). |
Sure, you can make link to that file, and navigate there :) But it does not unload the page, so it's almost a JS API, although it's a hack... |
But that's what we do now when you return a file on postback. Or what did you mean by direct support for file downloads? |
The function will be named |
When you call
Context.Redirect*
orContext.ReturnFile
, the redirect is performed immediately, so the viewmodel cannot be updated before the browser is instructed to make the download.We should create another set of methods that would be able to redirect or return a file after the postback is finished.
The text was updated successfully, but these errors were encountered: