How to work around Response / Server which does not exist in the context?
<p>I have this C# ASP.NET 4 website.</p>

<p>I would like to have a general method in a class which will include a Response.Redirect or Server.Transfer in it to a specific page.</p>

<p>Both names, Response and Server, does not exist in the context.</p>

<p>How to work this around?</p>

<hr>

<p>as for the comment by @Maess, please consider something like this (edited):</p>

<p><strong>ASPX:</strong></p>

<pre><code>&lt;asp:Button onclick="MyClass.btnRedirect_Click" ID="btnMyButton" Text="MyButtonText" runat="server" /&gt;
</code></pre>

<p><strong>Code behind:</strong></p>

<pre><code>public static void btnRedirect_Click(object sender, EventArgs e)
{
    Response.Redirect("~/SomePage.aspx");
}
</code></pre>
