J
Jack
Hi,
I have a datagrid and I'm wanting to access one of the hyperlinks
which is located in Template Column i.e.
<asp:TemplateColumn HeaderText="Action">
<HeaderStyle Width="100px"></HeaderStyle>
<ItemTemplate>
<asp:hyperlink ID="DeleteHyperlink" runat="server"
NavigateUrl="main.aspx">Delete</asp:hyperlink>
</ItemTemplate>
</asp:TemplateColumn>
I need to do this because I want to add some javascript to the
Attributes property ( i.e. DeleteHyperlink.Attributes.Add("OnClick",
"return confirm('Doyou really want todelete?'")
How do I find this control in the ItemDataBound event???
I tried this but it didn't work:
Dim ExpireAncor As HyperLink =
CType(e.Item.FindControl("ExpireAncor"), HyperLink)
Any suggestions would be great.
Cheers,
Jack
I have a datagrid and I'm wanting to access one of the hyperlinks
which is located in Template Column i.e.
<asp:TemplateColumn HeaderText="Action">
<HeaderStyle Width="100px"></HeaderStyle>
<ItemTemplate>
<asp:hyperlink ID="DeleteHyperlink" runat="server"
NavigateUrl="main.aspx">Delete</asp:hyperlink>
</ItemTemplate>
</asp:TemplateColumn>
I need to do this because I want to add some javascript to the
Attributes property ( i.e. DeleteHyperlink.Attributes.Add("OnClick",
"return confirm('Doyou really want todelete?'")
How do I find this control in the ItemDataBound event???
I tried this but it didn't work:
Dim ExpireAncor As HyperLink =
CType(e.Item.FindControl("ExpireAncor"), HyperLink)
Any suggestions would be great.
Cheers,
Jack