Good Morning,
I've a problem with a textfiled inside a datalist, in particular it's value
it is not updated with the changes,
I mean sNomeCampo has still the value coming from the dB and not that
changed by the user,
May you help me ???
Antonio D'Ottavio
www.etantonio.it/en
Here's the code :
void Update_Command( Object sender, DataListCommand EventArgs e)
{
String sNomeCampo =
((TextBox)e.Ite m.FindControl(" NomeCampo")).Te xt;
}
<ASP:DataList id="MyDataCampi " runat="server" HorizontalAlign ="Center"
RepeatDirection ="Horizontal " RepeatColumns=" 1"
OnEditCommand=" Edit_Command" OnUpdateCommand ="Update_Comman d"
OnDeleteCommand ="Delete_Comman d" OnCancelCommand ="Cancel_Comman d"
OnItemDataBound ="BindComboe s"
<ItemTemplate >
<tr style="backgrou nd-color:CCFF99">
<td width=10% align="center">
<asp:LinkButt on id="EditButton " Text="Edit"
CommandName="Ed it" runat="server"/>
<input id="HiddenIDCam po" type="hidden" value='<%#
DataBinder.Eval (Container.Data Item, "IDCampo") %>' runat="server" />
</td>
<td>
<%# DataBinder.Eval (Container.Data Item,
"NomeCampo" )%>
</td>
</tr>
</ItemTemplate>
<EditItemTempla te>
<asp:LinkButt on id="UpdateButto n"
Text="Update"
CommandName="Up date"
runat="server"/>
<td>
<asp:TextBox id="NomeCampo"
Text='<%# DataBinder.Eval (Container.Data Item,
"NomeCampo" ) %>'
runat="server"/>
</td>
</EditItemTemplat e>
</ASP:DataList>