On Selected, take a value from G.V and redirect user on another page and get the value .Execute code only if is redirected from page1
<p>I have a simple gridview and sqldatasource to bind data to gridview.</p>

<ul>
<li>My goal is to make in the gridview when the user is selecting a row ,
to take a value from a column for the current editing row , then
redirect him to the other page and there to work with the value taken
from the main page.</li>
</ul>

<p>In the example below I've just used a static string, not value taken from gridview.</p>

<p>On WebForm1.aspx:</p>

<pre><code>protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
    string selectedvalue = "test";
    Response.Redirect("http://localhost:53253/WebForm2.aspx?selectedValue=" + selectedvalue);
}
</code></pre>

<p>on WebForm2.aspx:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    string take = Request.QueryString["selectedValue"];
    Label1.Text = take.ToString();
}
</code></pre>

<p>The problem is in WebForm2.aspx I want the code to work only if it's called from the main page with the GridView1_SelectedIndexChanged code.</p>

<p>Because I also want to access the WebForm2 page without getting the code if I'm redirected from webform1.</p>
