Friday, August 15, 2025

How to view the image in browser from database - binary image from database - asp.net

  string alert1 = "var image = new Image();";

        alert1+= "image.src='data:image/jpg;base64,"+ Convert.ToBase64String(bytes)+"';";

        alert1 += "var w = window.open('');";

              alert1+= "w.document.write(image.outerHTML);";


           ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenNewTabScript", alert1, true);


ref:-https://stackoverflow.com/questions/27798126/how-to-open-the-newly-created-image-in-a-new-tab

No comments:

Post a Comment