I m working on a asp.net which, which has 2 buttons to generate files.
on one button click i generate a file and give user a popup of save.
on other button click i generate file and save file on the local machine.
On each button click, i need to update the button click time in database and show last button click time on the screen using labels.
In each button click event, i have called UpdateTimeOnScreen() function
In
UpdateTimeOnScreen()
function, i fetch last time button click from databse and show that time using labels
On one button that saves files on machine, the time is getting properly updated on screen.
but on other button click, that gives user a popup of save, the time is not getting updated.
I saw using debug, the above
UpdateTimeOnScreen()
is called properly and in that function, time is also assigned to labels but after execution of the code
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.AddHeader("Content-Length", bufferDataArray.Length.ToString());
Response.ContentType = "text/plain";
Response.BinaryWrite(bufferDataArray);
Response.End();
the labeltext , gets text as '
[System.Threading.ThreadAbortException] = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
' and time in the label is not getting updated
How to solve this issue?