Array
(
)

Evento RowCommand - como utilizar?

Ricardo
   - 22 dez 2015

Bom dia, estou com dificuldade para utilizar o evento RowCommand em Asp .net com C#, estou utilizando o Visual Studio Express 2012 for Web.
Como faço para adicionar esse evento na minha aplicação?
Tentei da seguinte forma, mas quando rodo a aplicação está dando erro, sem o "OnRowCommand", os dados são exibidos na página.
#Código
<asp:GridView ID="GridView3" runat="server" OnSelectedIndexChanged="GridView3_SelectedIndexChanged" AutoGenerateColumns="False" OnRowCommand="GridView3_RowCommand">
<Columns>
<asp:BoundField DataField="ramal" HeaderText="Ramal" />
<asp:BoundField DataField="nome" HeaderText="Nome" />
</Columns>
</asp:GridView>

ERRO:
#Código
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'ASP.rowcommand_aspx' does not contain a definition for 'GridView3_RowCommand' and no extension method 'GridView3_RowCommand' accepting a first argument of type 'ASP.rowcommand_aspx' could be found (are you missing a using directive or an assembly reference?)
Source Error:

Line 119: <%-- grid lista ramais Teste rowcommand --%>
Line 120: lista ramais - teste row command <p></p>
Line 121: <asp:GridView ID="GridView3" runat="server" OnSelectedIndexChanged="GridView3_SelectedIndexChanged" AutoGenerateColumns="False" OnRowCommand="GridView3_RowCommand">
Line 122: <Columns>
Line 123: <asp:BoundField DataField="ramal" HeaderText="Ramal" />
Source File: c:\Users\Admin\Documents\Visual Studio 2012\Projects\Teste\Teste\RowCommand.aspx Line: 121

Show Detailed Compiler Output:
Show Complete Compilation Source:

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34280

Obrigado!