Home All Groups Group Topic Archive Search About

Help on LinkButton vs PushButton ??

Author
13 Jan 2006 12:05 PM
serge calderara
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

Author
13 Jan 2006 2:39 PM
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
Show quoteHide quote
"serge calderara" <sergecalder***@discussions.microsoft.com> wrote in
message news:E708876D-EEBC-4EC2-92B0-103203429615@microsoft.com...
> 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

Bookmark and Share