Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Textbox value in the edittemplate of a datalist doesn't report the changes

Reply
Thread Tools

Textbox value in the edittemplate of a datalist doesn't report the changes

 
 
Antonio D'Ottavio
Guest
Posts: n/a
 
      09-26-2005
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>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls reference inside DataList's EditTemplate Peter ASP .Net 1 07-02-2009 05:21 PM
Update SqlDataSource with value of DropDownList in EditTemplate on GridView ES ASP .Net Web Controls 0 06-16-2006 10:24 PM
Textbox value in the edittemplate of a datalist doesn't report the changes Antonio D'Ottavio ASP .Net 2 09-26-2005 03:26 PM
Textbox value in the edittemplate of a datalist doesn't report the changes Antonio D'Ottavio ASP .Net 2 09-26-2005 03:26 PM
Accesing Items in datalist edittemplate Gönen EREN ASP .Net 0 08-22-2003 05:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57