views:

35

answers:

0

In the button "Export to XML" i am calling a "DownloadXML.ashx"

After which, i would like to refresh the page to show the latest status as "Exported"

I have tried to (1) RefreshDetails then call the ashx (2) Redirect to the current page then call the ashx

But it all doesn't seem to work.

Any help plz???

for (1) the button click after RefreshDetails(text boxes), and (2) Page_Load event, i just call the following code

Response.Redirect("DownloadXMLFile.ashx?name=" + fileName);

below is the ashx file

public class DownloadXMLFile : IHttpHandler {

public void ProcessRequest (HttpContext context) {
    string fileName = context.Request.QueryString["name"].ToString() + ".xml";
    string tempFileName = "temp.xml";
    HttpResponse r = context.Response;
    r.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
    r.ContentType = "text/xml";
    r.WriteFile(context.Server.MapPath(tempFileName));
}

public bool IsReusable {
    get {
        return false;
    }
}

}/