i have a handler that generates a csv file and provide the download, this handler called by button in codebehind on my defoult.aasp like this:
Response.Redirect("~/Handler.ashx?startDate="+tbStartDate.Text.Trim()+"&endDate="+tbEndDate.Text+"&isCheck="+chkDuplication.Checked.ToString());
now I have a another line after above code were should update my list view, but list view not getting updated, is there any way that I can update the list view after csv download.
Thanks,
The problem is with your redirect. From the Microsoft documentation:
You have a couple of options depending on the processing that needs to occur:
If you do not need to post the page back in order to open the file, you can open a new window in javascript (window.open with a target of ‘_blank’) using your ashx page (including its query string) as the URL.
If your page needs to postback, you can generate the javascript on the server side and have it execute when the page is first reloaded into the browser using Page.ClientScript.RegisterStartupScript.
We actually use both methods depending on the specific requirements. Generally, we prefer the first approach, even if it means a little more work in javascript, but sometimes postbacks can’t be avoided.