Setting id to a panel control in gridview
<p>I have a panel control in gridview's template.<br>
I need to hide/unhide panel in javascript function, for that i need to pass panel's id to the javascript.  </p>

<p>The problem is that all panels have the same id in gridview, so I need to set unique id to each panel.<br>
I tried to do:</p>

<pre><code>&lt;asp:Panel id= "Panel_&lt;%# Eval("ID")%&gt;"
</code></pre>

<p>and some other variations but always get an error.</p>

<p>The panel contains some other controls, I need it to be server side because I need to set at code-behind (after checking if user is authenticated) </p>

<p>What can I do?</p>

<p>p.s.<br>
It doesn't have to be Panel, any other control that I can find with Findcontrol and can hold other controls.</p>

<p><strong>Update:</strong>  </p>

<pre><code>I set the the js event in code behind:
protected void gvw_RowCreated(object sender, GridViewRowEventArgs e)
{
   if (e.Row.RowType == DataControlRowType.DataRow)
   {

     if (UserIsAuthenticated)
     { 
         HyperLink title = e.Row.FindControl("lnkTitle") as HyperLink; 
        Panel panel = e.Row.FindControl("panel") as Panel; 
        title.Attributes.Add("onmouseover", "ShowHidePanel(" + panel.ClientID +")");
        //All get the same id!!!
     }
   }
}
</code></pre>
