FormView Datakey Value
<p>I have two web pages- the first is a <code>GridView</code> and the second is a <code>FormView</code>.  I have been able to retrieve the <code>DataKey</code> value from the <code>GridView</code> and pass it to the <code>FormView</code> page.  Now I need to use that key value for my selection query.  How do I assign that value?  Code example would help in C#.</p>

<p>This is my <code>page_load</code> code:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    string CompanyStr = Server.HtmlEncode(Request.QueryString["param1"]);
    string ClientKey = Request.QueryString["param2"];

    Label lbl = FormView1.FindControl("CompanyID") as Label;
    lbl.Text = CompanyStr;
 }
</code></pre>

<p>And this is the <code>FormView</code> code:</p>

<pre><code>&lt;asp:FormView ID="FormView1" runat="server" DefaultMode="Insert" DataKeyNames="ClientKey"
    DataSourceID="SqlDataSource1" onitemcommand="onItemCommand"&gt;
</code></pre>

<p>The <code>ClientKey</code> is the variable that needs to be set.</p>
