Both methods calls Response.End method internally ends the page execution. Then executes Application_EndRequest event in the application's event pipeline and hence the line of code that follows Response.End is not executed which is raising the exception.
To overcome this just disable Response.End in both methods as follows :-
Server.Transfer(Request.FilePath);
Response.Redirect(Request.FilePath);
to
Server.Execute(Request.FilePath);
Response.Redirect(Request.FilePath,false);
Computers are composed of nothing more than logic gates stretched out to the horizon in a vast numerical irrigation system.
Stan Augarten
To overcome this just disable Response.End in both methods as follows :-
Server.Transfer(Request.FilePath);
Response.Redirect(Request.FilePath);
to
Server.Execute(Request.FilePath);
Response.Redirect(Request.FilePath,false);
Computers are composed of nothing more than logic gates stretched out to the horizon in a vast numerical irrigation system.
Stan Augarten