Can't find Item property inside databound event (Whidbey)

B

Benton

Hi there,

I am using ASP.NET 2.0 and need multiple parameters in Hyperlink column so I
add this to my DataGridView:

<asp:TemplateField>
<ItemTemplate><asp:Hyperlink text="Edit" id="hylEdit"
runat="server"></asp:Hyperlink></ItemTemplate>
</asp:TemplateField>

Now in the DataBound event I need to find the Hyperlink object in order to
set the NavigateUrl property. I found this example on the web (for ASP.NET
1.x):

HyperLink obj = ((HyperLink)(e.Item.FindControl("hylEdit")));

However, I get a 'System.EventArgs' does not contain a definition for 'Item'
error. How can I get this to work in ASP.NET 2.0? Now, if there is a better
solution for my original problem using Whidbey, I would be even happier. :)

Thanks in advance,

-Benton
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top