Try adding
Response.End();
after the call to Response.BinaryWrite().
You may inadvertently be sending other content back after Response.BinaryWrite which may confuse the browser. Response.End will ensure that that the browser only gets what you really intend.
Related Contents:
- Reach control from another page. ASP.Net
- One DbContext per web request… why?
- Why is access to the path denied?
- Problem with converting int to string in Linq to entities
- What is the purpose of a question mark after a type (for example: int? myVariable)?
- Run async method regularly with specified interval
- Difference between RegisterStartupScript and RegisterClientScriptBlock?
- Lifetime of ASP.NET Static Variable
- How to set session timeout in web.config
- Finding all positions of substring in a larger string in C#
- Unable to update the EntitySet – because it has a DefiningQuery and no element exist
- An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode
- Why is HttpContext.Current null after await?
- How to get the groups of a user in Active Directory? (c#, asp.net)
- prevent property from being serialized in web API
- Where does error CS0433 “Type ‘X’ already exists in both A.dll and B.dll ” come from?
- Alternatives to System.Drawing for use with ASP.NET?
- Mobile Device Detection in asp.net
- Can I set up HTML/Email Templates with ASP.NET?
- What’s better: DataSet or DataReader?
- What’s the difference between the WebConfigurationManager and the ConfigurationManager?
- Using static variables instead of Application state in ASP.NET
- Async Void, ASP.Net, and Count of Outstanding Operations
- Accessing Office Word object model through asp.net results in “failed due to the following error: 80070005 Access is denied.”
- How to not serialize the __type property on JSON objects
- How can I trigger/refresh my main .RAZOR page from all of its sub-components within that main .RAZOR page when an API call is complete?
- The result of a query cannot be enumerated more than once
- Cannot deserialize the current JSON array (e.g. [1,2,3]) into type
- How do I route images using ASP.Net MVC routing?
- An error occurred during report processing. -RLDC reporting in ASP.NET MVC
- Setting the default value of a DateTime Property to DateTime.Now inside the System.ComponentModel Default Value Attrbute
- Create thumbnail image
- Parsing a JSON array using Json.Net
- Encrypting Web.Config
- What is passing parameters to SQL and why do I need it?
- How can I secure passwords stored inside web.config?
- No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization
- LINQ to SQL Where Clause Optional Criteria
- Should I use byte or int?
- ASP.NET Is there a better way to find controls that are within other controls?
- How to delete cookies on an ASP.NET website
- “new” keyword in property declaration in c#
- Application_Error in global.asax not catching errors in WebAPI
- Change GridView row color based on condition
- How to map JSON to C# Objects
- Determine OS using Environment.OSVersion [duplicate]
- Recursive TreeView in ASP.NET
- Download file from FTP and how prompt user to save/open file in ASP.NET C#
- How to return a PDF from a Web API application
- How to get the output of a System.Diagnostics.Process?