use a if condition to find which page redirects to current page in asp.net
<p>I am redirecting to sendmessage page from group page and user page. In the sendmessage server side code how can I find which page redirected to send message page. since I have different code for each page i need to use a if condition to determine it. how to code the if condition.</p>

<p>From user page </p>

<pre><code> &lt;asp:ImageButton ID="SendButton" ImageUrl="Styles/Images/Message.jpg" Enabled="True" Width="" runat="server" PostBackUrl='&lt;%# Eval("Email", "SendMessage.aspx?Email={0}") %&gt;'&gt;&lt;/asp:ImageButton&gt;
</code></pre>

<p>From Group page</p>

<pre><code>&lt;asp:ImageButton ID="SendButton" ImageUrl="Styles/Images/Message.jpg" Enabled="True" Width="" runat="server" PostBackUrl='&lt;%# Eval("groupname", "SendMessage.aspx?=groupname={0}") %&gt;'&gt;&lt;/asp:ImageButton&gt;
</code></pre>

<p>I tried this but it didn't work</p>

<pre><code>string url = Request.UrlReferrer.AbsoluteUri;
        if (Request.UrlReferrer.AbsoluteUri.ToLower().Contains("SendMessage.aspx?GroupName"))
{}
</code></pre>

<p>[url= http://localhost:48996/SurelyK/SendMessage.aspx?GroupName=iCam]</p>
