i want to show the image in window.open from image path where it is stored in java scripts.
JavaScript
function DownloadFile(id) {
$.ajax({
type: "POST",
url: '',
data: "{'id':'" + id + "'}",
contentType: "application/json; charset=utf-8",
datatype: "json",
success: function (data) {
var msg = eval('(' + data.d + ')');
var url = msg[0].FilePath;
img = '';
popup = window.open(img);.CS Code
C#
[WebMethod]
public static string DownloadFiles(string id)
{
string data = string.Empty;
try
{
DataTable dt = MasterEntry.GetFileName(id);
var obj = from row in dt.AsEnumerable()
select new
{
FilePath = row["FilePath"].ToString(),
};
JavaScriptSerializer serializer = new JavaScriptSerializer();
data = serializer.Serialize(obj);
return data;
}
catch
{
return data;
}
}plesae help me as soon as possible

Sachin SinghRank #66 · 26.2K reputationPosted Nov 9, 2021, 11:40 PM EST
function DownloadFile(id) { $.ajax({ type: "POST", url: '', data: "{'id':'" + id + "'}", contentType: "application/json; charset=utf-8", datatype: "json", success: function (data) { var image = new Image(); image.src = "data:image/jpg;base64," + data.d; var w = window.open(""); w.document.write(image.outerHTML); }Sandeep KumarRank #1,642 · 937 reputationPosted Nov 10, 2021, 1:41 AM EST
Sandeep KumarRank #1,642 · 937 reputationPosted Nov 10, 2021, 2:07 AM EST