ImageButton inside of a DataGrid

G

Guest

I have an Image Button inside of a Datagrid and its not firing the
datagrid.itemcommand event when it is clicked. Does anyone have a link to a
tutorial or a solution for this problem?

For my datagrid I do have the OnItemCommand propert set.

<asp: Datagrid id="DataGrid1" runat="server" OnItemCommand="gStarted">

In the code the function is:

public sub gStarted(byval sender as object, byval e as
datagridCommandEventArgs) handles DataGrid1.itemCommand

This is not firing the event.
 
T

Teemu Keiski

Hi,

first make sure that you are binding the grid in page_load inside "If Not
Page.IsPostBack Then" check. If you aren't (missing the check) it will
rebind the grid, and "eat" up the postback events.
 
G

Guest

That did it. Just started ASP and still getting used to the client/server and
postback things. Thanks a bunch. It threw me off because it was firing
linkbuttons in that same datagrid.
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top