To clarify a little:
According to MSDN the boolean argument:
"Indicates whether execution of the current page should terminate."
When called with true, "Redirect() calls End() which raises a ThreadAbortException exception upon completion." (from MSDN)
This is an important feature because you might want to redirect the browser without letting any more code execute. For example, if you need to check for the existence of some resource (file, database record, etc.) before continuing and wish to redirect the user away from the page if the resource doesn't exist, you could force the termination of the page execution to avoid running any code that uses that resource. My personal opinion is that one should program around that possibility and finish the page gracefully when possible. However, you can't prevent postback events from firing, so there is a legitimate reason for forcing termination.
The @ notation has nothing to do with the method being used. It's a string formatting notation in C# that forces the program to ignore escaped characters inside the literal string. Thus, these two examples are equivelant:
filePath = "C:\\Temp\\myfile.txt";
filePath = @"C:\Temp\myfile.txt";
The forward slash [/] is not an escaped character. You can do this without problem:
redirectUrl = "folder/somepage.aspx";
-
Peter