Setting id to a panel control in gridview

Posted by mariki on Stack Overflow See other posts from Stack Overflow or by mariki
Published on 2010-03-15T22:32:23Z Indexed on 2010/03/15 22:39 UTC
Read the original article Hit count: 226

Filed under:

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

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

<asp:Panel id= "Panel_<%# Eval("ID")%>"

and some other variations but always get an error.

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)

What can I do?

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

© Stack Overflow or respective owner

Related posts about ASP.NET