07-24-2023, 05:06 AM
I currently have a button on my aspx, when it is clicked, it calls a method to download a jpeg file from a server. The Jpeg file is a chart created with Infragistic.
My current Download method is this:
private void DownLoad(string pImagen)
{
Context.Response.ClearContent();
Context.Response.Clear();
Context.Response.ContentType = "application/jpeg";
Context.Response.AddHeader("Content-Disposition", "attachment; filename =" + pImagen);
Context.Response.Flush();
Context.Response.TransmitFile(ConfigurationManager.AppSettings["UploadPath"] + pImagen);
Context.Response.End();
}
But after the method is executed, a JSruntime error pops up:
Microsoft JScript runtime error: System error: -1072896748.
The error is located in a file called "ig_shared.js" in this method:
this._doResponse = function(cb)
{
var request = cb.request;
if(!request || request.readyState != 4)
return false;
var txt = request.responseText, sep = this._sep, sepLen = this._sepLen;
When i debug, Visual Studio shows a message that says "The name 'Request' does not exist in the current context" in this code line:
var txt = request.responseText
Maybe I'm missing something, but i have no idea what could be wrong.
My current Download method is this:
private void DownLoad(string pImagen)
{
Context.Response.ClearContent();
Context.Response.Clear();
Context.Response.ContentType = "application/jpeg";
Context.Response.AddHeader("Content-Disposition", "attachment; filename =" + pImagen);
Context.Response.Flush();
Context.Response.TransmitFile(ConfigurationManager.AppSettings["UploadPath"] + pImagen);
Context.Response.End();
}
But after the method is executed, a JSruntime error pops up:
Microsoft JScript runtime error: System error: -1072896748.
The error is located in a file called "ig_shared.js" in this method:
this._doResponse = function(cb)
{
var request = cb.request;
if(!request || request.readyState != 4)
return false;
var txt = request.responseText, sep = this._sep, sepLen = this._sepLen;
When i debug, Visual Studio shows a message that says "The name 'Request' does not exist in the current context" in this code line:
var txt = request.responseText
Maybe I'm missing something, but i have no idea what could be wrong.