DataGrid and OnClick Event???

G

Guest

Can someone please tell me how I get around this problem! I want to send a
querystring to a page so the user can edit the page info... I tried to use an
onClick event but I keep getting the following error...

Thanks for any help!

Compiler Error Message: BC30408: Method 'Public Sub
LinkButton_OnClick(sender As Object, e As
System.Web.UI.WebControls.DataGridCommandEventArgs)' does not have the same
signature as delegate 'Delegate Sub EventHandler(sender As Object, e As
System.EventArgs)'.

...Codebehind..
Sub LinkButton_OnClick(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim PageEdit As LinkButton = CType(e.Item.FindControl("PageEdit"),
LinkButton)
PageEdit.Attributes("onclick") = "'default.aspx?id=" & 1 & "'"

End Sub

Inline Code..

<asp:TemplateColumn>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:LinkButton onclick="LinkButton_OnClick" Text="<img border=0
src=../images/edit.gif alt='Edit Page'>" ID="PageEdit" Runat="server" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateColumn>
 

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,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top