top of page

Market Research Group

Public·202 members

Julian Bell
Julian Bell

Download Now (V3) [your_file_ready_to_download] \/\/FREE\\\\


I have a C# program which will be used to download a generated word document. Also, after generating it, the 'Hour Glass' property in UI has to be reset to default. For that I am calling one javascript function using scriptmanager, which can be executed only if the statement appears at the last. Unfortunately, a step before there is a code to download the word document. when it happens, the program gets lost and never goes back and execute the remaining part of the program in which the script manager is present to stop the hourglass. Putting script manager ahead of the downloading code also wont help. I suffer a lot from this peculiar problem. Please help, Thank you!!




Download Now (V3) [your_file_ready_to_download]



When Response.End() is called, you will no longer get a response back from the server because Response.End() throws an exception by nature and you can do nothing about it. What you need to do is switch the order. Once you have your file ready to download, use ScriptManager to register a script that does __doPostBack with a particular argument. Later in Page_Load you will read that argument and execute the download accordingly. Meanwhile, after ScriptManager.RegisterStartupScript (or ScriptManager.RegisterClientScriptBlock), Do your clean up logic.


Now your next question will be: Is that the 'neatest' possible way to do it? Basically, if you insist on having everything on the same page then yes you'll have to implement such a workaround. However, the general trend is to open up another tab (new page) that only does the download. One popular example is Microsoft website. Check how you download .NET Framework here. 041b061a72


About

Welcome to the group! You can connect with other members, ge...

Group Page: Groups_SingleGroup

Subscribe Form

Thanks for submitting!

774-565-4077

  • Facebook
  • LinkedIn

©2022 All Rights Reserved.
* The statements made regarding products have not been evaluated by the Food and Drug Administration. The efficacy of these products has not been confirmed by FDA-approved research. These products are not intended to diagnose, treat, cure or prevent any disease. All information presented here is not meant as a substitute for or alternative to information from health care practitioners. Please consult your health care professional about potential interactions or other possible complications before using any product. The Federal Food, Drug and Cosmetic Act requires this notice.

bottom of page