Hello,
I have grid with row selection using check box column. with button click i am updating status for selected records at databas side and saving one file on sever which i am downloading after database work. I need to rebind grid once file is downloaded at client side. But after file download its not executing command grid.rebind()
Here is my code
I have grid with row selection using check box column. with button click i am updating status for selected records at databas side and saving one file on sever which i am downloading after database work. I need to rebind grid once file is downloaded at client side. But after file download its not executing command grid.rebind()
Here is my code
errStr = _ach.UpdateACHStatus(dtACH);
View.DownloadACHFile(sACHFileName, true);
rgACH.rebind();
Here is the code for download file
| public void DownloadACHFile(string fname, bool forceDownload) | |
| { | |
| string path = MapPath(fname); | |
| string name = Path.GetFileName(path); | |
| string ext = Path.GetExtension(path); | |
| string type = ""; | |
| if (ext != null) | |
| { | |
| switch (ext.ToLower()) | |
| { | |
| case ".htm": | |
| case ".html": | |
| type = "text/HTML"; | |
| break; | |
| case ".txt": | |
| type = "text/plain"; | |
| break; | |
| case ".doc": | |
| case ".rtf": | |
| type = "Application/msword"; | |
| break; | |
| } | |
| } | |
| if (forceDownload) | |
| { | |
| Response.AppendHeader("content-disposition", | |
| "attachment; filename=" + name); | |
| } | |
| if (type != "") | |
| Response.ContentType = type; | |
| Response.WriteFile(path); | |
| Response.End(); | |
| } | |
I need to refresh grid once download process completes. But somehow rgACH.Rebind(); is not getting executed.
Please help.
Thanks.