<p>I am working on a project management web application.  The user has a variety of ways to display a list of tasks.  When viewing a list page, they click on task and are redirected to the task edit page.  </p>

<p>Since they are coming from a variety of ways, I am just curious as to the <strong>best</strong> way to <strong>redirect</strong> the user back to the calling page.  I have some ideas, but would like to get other developers input.</p>

<p>Would you store the <strong>calling</strong> url in session? as a cookie?  I like the concept of using an object <strong>handle</strong> the redirection.</p>

I personally would store the required redirection info in an object and handle globally. I would avoid using a QueryString param or the like since they could try bouncing themselves back to a page they are not supposed to (possible security issue?). You could then create a static method to handle the redirection object, which could read the information and act accordingly. This encapsulates your redirection process within one page.
Using an object also means you can later extend it if required (such as adding return messages and other info).
For example (this is a 2 minute rough guideline BTW!):
```
```
public partial class _Default : System.Web.UI.Page 
{

    void Redirect(string url, string messsage)
    {
        RedirectionParams paras = new RedirectionParams(url, messsage);
        RedirectionHandler(paras); // pass to some global method (or this could BE the global method)
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Redirect("mypage.aspx", "you have been redirected");
    }
}

public class RedirectionParams
{
    private string _url;

    public string URL
    {
        get { return _url; }
        set { _url = value; }
    }

    private string _message;

    public string Message
    {
        get { return _message; }
        set { _message = value; }
    }

    public RedirectionParams(string url, string message)
    {
        this.URL = url;
        this.Message = message;
    }
}
```
```