Help on LinkButton vs PushButton ??

G

Guest

Dear all,

If I used the following code on a datagrid object

<Columns>
<asp:ButtonColumn Text="Events" ButtonType=LinkButton
CommandName="ShowEvent">
</asp:ButtonColumn>
</Columns>

then the datagrid_ItemCommand event is fired but when I replace the Button
type to be PushButton instead, then it is not fired anymore

What is the difference between those 2 button type?
Which event fired when clicking on the PushButton type ?

regards
serge
 
S

S. Justin Gengo [MCP]

Serge,

The button column is built in to use command events which are triggered
automatically. The push button operates in much the same way, but it won't
automatically have an event associated with it from within the datagrid. If
you want to use a button from within the grid you should set which
subroutine you want it to run by specifying the subroutine's name with the
button's "OnClick" property.

<asp:Button Text="Events" Id="MyButton" Runat="server"
OnClick="YourSubroutineNameHere"></Button>

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top