How to declare function in MasterPage.Master instead of code-behind?
<p>In my MasterPage.Master I have this code:</p>

<pre><code>&lt;% if (Convert.ToBoolean(Session["FullVersion"])) { %&gt;
    &lt;asp:LinkButton ID="LinkButton1" Text="Gå til mobilversjon"     OnClick="GoToMobileVersion" runat="server" /&gt;
&lt;% } %&gt;
</code></pre>

<p>Instead of declaring this function in MasterPage.master.cs like this:</p>

<pre><code>protected void GoToMobileVersion(object sender, EventArgs e)
{
    PageBase page = (PageBase)Page;
    page.Session["FullVersion"] = false;
    Response.Redirect(Server.UrlPathEncode(page.CurrentPage.LinkURL));
}
</code></pre>

<p>I would like to do the declare the function in  MasterPage.Master.
What syntax would I use to do this?</p>

<p>Here is what I want to do:</p>

<pre><code>    &lt;% 
protected void GoToMobileVersion ()
{
Session["FullVersion"] = false;
Server.TransferRequest(Request.Url.AbsolutePath, false);
}
%&gt;
</code></pre>
