Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am retrieving binary file stored in sql and displaying it on a popup page without problem. But I want to have a button on the same page for further processing. The button on the page disappears when displaying any sort of file, pdf or image.
So how can I keep a button visible and functioning ?

My code is like following :
C#
protected void Page_Load(object sender, EventArgs e)

// db connection, byte array create etc..

Response.binaryWrite(objdata);
Response.End();


What I have tried:

I tried creating some divs ın the page, no success.
Posted
Updated 13-Apr-18 5:04am
v2
Comments
Member 11904252 16-Apr-18 10:54am    
It seems that nobody has any solution yet..

Of course it does. You didn't send a mime type with the context so every browser si going to treat it as text by default.

The mime type tells the browser what the content is that you're sending back so it can figure out what to do with it.

You have to set the Repsonse.ContentType with an appropriate mime type string for the content you're returning, such as "application/pdf", "image/png", or whatever.
 
Share this answer
 
I actually have : Response.ContentType = "application/pdf";
otherwise it does not display the pdf file. Despite this the button is hidden.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900