PushButton event

M

Mark

Rather than using a LinkButton for "Edit" and "Delete" in my DataGrid, I
changed them to a PushButton style. How do you capture the event? It
doesn't appear to work like a LinkButton.

Thanks in advance!
Mark
 
S

Saravana

how did you changed to push button style, did you used buttontype property
to mention it as pushbutton.In that case you can catch event as you do with
link button style. You can write code for EditCommand event handler.
 
M

Maciek Pawlowski

I have had the same problem. I changed the button type property to
pushbutton in the property
builder. However, the event doesn't seem to fire....unless I set the
enableviewstate of the datagrid to false...
Am I missing something?
 
M

Mark

Got it to work. I don't understand it, but it works. Below is all I
changed:

Old code in Page_Load:

dgSir.DataBind();

New Code in Page_Load:

if (!IsPostBack)
{
dgSir.DataBind();
}

So, why would the PushButton be affected by a re-binding of the data, but
the LinkButton wouldn't?

Thanks.

Mark
 

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,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top