A
Antonio D'Ottavio
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, DataListCommandEventArgs e)
{
String sNomeCampo =
((TextBox)e.Item.FindControl("NomeCampo")).Text;
}
<ASPataList id="MyDataCampi" runat="server" HorizontalAlign="Center"
RepeatDirection="Horizontal" RepeatColumns="1"
OnEditCommand="Edit_Command" OnUpdateCommand="Update_Command"
OnDeleteCommand="Delete_Command" OnCancelCommand="Cancel_Command"
OnItemDataBound="BindComboes"
<ItemTemplate>
<tr style="background-color:CCFF99">
<td width=10% align="center">
<asp:LinkButton id="EditButton" Text="Edit"
CommandName="Edit" runat="server"/>
<input id="HiddenIDCampo" type="hidden" value='<%#
DataBinder.Eval(Container.DataItem, "IDCampo") %>' runat="server" />
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"NomeCampo")%>
</td>
</tr>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton id="UpdateButton"
Text="Update"
CommandName="Update"
runat="server"/>
<td>
<asp:TextBox id="NomeCampo"
Text='<%# DataBinder.Eval(Container.DataItem,
"NomeCampo") %>'
runat="server"/>
</td>
</EditItemTemplate>
</ASPataList>
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, DataListCommandEventArgs e)
{
String sNomeCampo =
((TextBox)e.Item.FindControl("NomeCampo")).Text;
}
<ASPataList id="MyDataCampi" runat="server" HorizontalAlign="Center"
RepeatDirection="Horizontal" RepeatColumns="1"
OnEditCommand="Edit_Command" OnUpdateCommand="Update_Command"
OnDeleteCommand="Delete_Command" OnCancelCommand="Cancel_Command"
OnItemDataBound="BindComboes"
<ItemTemplate>
<tr style="background-color:CCFF99">
<td width=10% align="center">
<asp:LinkButton id="EditButton" Text="Edit"
CommandName="Edit" runat="server"/>
<input id="HiddenIDCampo" type="hidden" value='<%#
DataBinder.Eval(Container.DataItem, "IDCampo") %>' runat="server" />
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"NomeCampo")%>
</td>
</tr>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton id="UpdateButton"
Text="Update"
CommandName="Update"
runat="server"/>
<td>
<asp:TextBox id="NomeCampo"
Text='<%# DataBinder.Eval(Container.DataItem,
"NomeCampo") %>'
runat="server"/>
</td>
</EditItemTemplate>
</ASPataList>