PDA

View Full Version : Error with Internet Explorer 6.0-7.0



Sergey_Trigub
22 Nov 2010, 2:33 AM
Hi.

I have an error in IE 6.0-7.0 when I try to download file. After download file dialog was open site did not respond.
It is does not matter I press button Save or Open or even Cancel download file dialog.
If I press F5 after this site become work properly (not respond first time only).
Please, help me.

P.S. Sorry for my english? I'm not native.


Ext.BLANK_IMAGE_URL = "images/s.gif";

Ext.onReady(function() {
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());

Ext.QuickTips.init();

var
GridStore = new Ext.data.JsonStore({
url: "Handler1.ashx",
root: "rows",
idProperty: "ID",
successProperty: "success",
totalProperty: "count",
fields: [
{ name: "ID", type: "int" },
"FILE_NAME"
],
writer: new Ext.data.JsonWriter(),
autoSave: false,
batch: true,
baseParams: { demand_id: 901 }
}),
sm = new Ext.grid.RowSelectionModel({ singleSelect: true }),
viewport = new Ext.Viewport({
layout: 'border',
items: [
{
region: 'center',
xtype: "editorgrid",
clicksToEdit: 1,
store: GridStore,
sm: sm,
columns: [
{ dataIndex: "ID", header: "ID", hidden: true, width: 100, align: "center", sortable: false },
{ id: "ColFileName", dataIndex: "FILE_NAME", header: "file name", width: 100, align: "center", sortable: false }
],
autoExpandColumn: "ColFileName",
loadMask: true,
enableHdMenu: false,
listeners: {
rowdblclick: function(gr, rowIndex, e) {
location.href = 'attachment.aspx?id=' + gr.getSelectionModel().getSelected().id;
}
}
}]
})

GridStore.load();
});


Server code written on Asp.net is very simple:



using System.Web;
using System.Web.Services;

namespace WebApplication4
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";

if (context.Request["id"] == "1")
{
var b = new byte[10];
b[0] = 1;
context.Response.AddHeader("Content-Disposition", "attachment;filename=\"test.ts\"");
context.Response.ContentType = "application/octet-stream";
context.Response.OutputStream.Write(b, 0, b.Length);
}
else
{
string j =
"{\"success\":true,\"count\":4,\"rows\":[{\"ID\":362,\"DEMAND_ID\":901,\"FILE_NAME\":\"<a href=\\\"Handler1.ashx?id=1\\\">????-????? VITEK VT-6601 001.jpg<\\/a>\",\"IS_DELETED\":null},{\"ID\":363,\"DEMAND_ID\":901,\"FILE_NAME\":\"<a href=\\\"attachment.aspx?id=363\\\">????-????? VITEK VT-6601 002.jpg<\\/a>\",\"IS_DELETED\":null},{\"ID\":364,\"DEMAND_ID\":901,\"FILE_NAME\":\"<a href=\\\"attachment.aspx?id=364\\\">????-????? VITEK VT-6601 003.jpg<\\/a>\",\"IS_DELETED\":null},{\"ID\":361,\"DEMAND_ID\":901,\"FILE_NAME\":\"<a href=\\\"attachment.aspx?id=361\\\">????-????? VITEK VT-6601.jpg<\\/a>\",\"IS_DELETED\":null}]}";
context.Response.Write(j);
context.Response.Flush();
}
}

public bool IsReusable
{
get { return false; }
}
}
}