Function, datagrid and findcontrol

P

perceval

<ItemTemplate>
<asp:HyperLink id=HyperLink2 runat="server" CssClass="LABELGAUCHE"
NavigateUrl='<%# funcSite(DataBinder.Eval(Container,
"DataItem.WebSite")) %>' Target="_blank">Visit the
Website</asp:HyperLink>
</ItemTemplate>

i want in the function funcSite put hyperlink2.visible = false if there
is not a website

But i can't find the control. My datagrid name is dgWebSite

Thx
 
S

Scott Allen

Alternatively, you could use another data binding expression to set
the property (assuming language="c#"):

Visible='<%# DataBinder.Eval(Container, "DataItem.WebSite") != null
%>'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top