ASP.NET - Detech the Label Text To Pass Variable
<p>I am new to ASP.NET</p>

<p>What I try to do is capture the unique ID (ProposedID) in the lblProposedID field, and pass it to another page.  </p>

<p>Lable in the GridView</p>

<pre><code>&lt;asp:TemplateField HeaderText="ID" 
    SortExpression="ID" ItemStyle-Width="5%"&gt;
    &lt;ItemTemplate&gt;
    &lt;asp:Label ID="lblProposedID" runat="server" 
        Text='&lt;%#Eval("ProposedID") %&gt;'&gt;
    &lt;/asp:Label&gt;
    &lt;/ItemTemplate&gt;
    &lt;FooterTemplate&gt;
    &lt;/FooterTemplate&gt;
&lt;/asp:TemplateField&gt;
</code></pre>

<p>Code Behind</p>

<pre><code>private void GridView1_RowCreated(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
    String rColor;
    System.Drawing.ColorConverter colConvert = new ColorConverter();

    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        int RowNum = e.Row.RowIndex;
        if (RowNum % 2 == 1)
        {
            rColor = "#FFFFFF";
            //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#DDDDDD'");
        }
        else
        {
            rColor = "#F5F5F5";
            //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='" ++ "'");
        }

        e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(rColor);
        e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='" + rColor + "'");
        e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#00FFFF'");
        e.Row.Attributes.Add("onclick", "window.open('popup.aspx?ProposedID=" + (Label)  e.Row.FindControl("lblProposedID") + 
        "','cal','width=600,height=300,left=270,top=180')"); 
        //e.Row.Attributes["onclick"] = this.Page.ClientScript.GetPostBackClientHyperlink(this.GridView1, "Select$" + e.Row.RowIndex);
    }
}
</code></pre>

<p>This is the line when I couldn't get it to work.  </p>

<pre><code>e.Row.Attributes.Add("onclick", "window.open('popup.aspx?textbox={0}" + (Label)e.Row.FindControl("lblProposedID") + 
"','cal','width=600,height=300,left=270,top=180')"); 
</code></pre>

<p>Please help.  Thanks in advance.</p>
