Problemas com Edição de DataGrid
Olá pessoal, estou começando a mexer com ASP.NET no Visual Studio 2005 seguindo os tutoriais deste site: http://www.macoratti.net/aspn_edg.htm
Estou tentando fazer o tutorial sobre como fazer um DataGrid Editavel. Meu código está assim:
'código de conexão...<asp:DataGrid id="DatagridEditaDados" runat="server"AutoGenerateColumns="False"Width="700"BackColor="aqua"BorderColor="Blue"ShowFooter="false"CellPadding=3CellSpacing="0"Font-Name="Verdana"Font-Size="8pt"HeaderStyle-BackColor="#aaaadd"MaintainState="false"OnEditCommand="DataGrid_Edit"OnCancelCommand="DataGrid_Cancel"OnUpdateCommand="DataGrid_Atualiza"><Columns> <asp:EditCommandColumn ButtonType="LinkButton" CancelText="Cancelar" EditText="Editar" UpdateText="Atualizar" /> <asp:BoundColumn DataField="nome" HeaderText="Nome" ReadOnly="True" /> <asp:BoundColumn DataField="endereco" HeaderText="Endereço" /> <asp:BoundColumn DataField="email" HeaderText="E-Mail" /></Columns></asp:DataGrid>porém quando executo o código da esse tipo de erro:
>
Control 'DatagridEditaDados_ctl02_ctl00' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
****
Exception Details: System.Web.HttpException: Control 'DatagridEditaDados_ctl02_ctl00' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
alguém poderia me ajudar à resolver este problema? =\
Discussão (5)
Carregando comentários...