M
mintboy
hello
thank U for take a look this Message !
/////////////////c# code file
private void DataListClass_UpdateCommand(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
string UpdateName = ((TextBox)e.Item.FindControl("TextBoxName")).Text;//
here i can not get the text that i modified.
string UpdateLink = ((TextBox)e.Item.FindControl("TextBoxLink")).Text;//
it shows the old text .
//somebody
tell me change viewstate,
//but
it dose nothing for me.
mydsClass.Tables["class"].Rows[e.Item.ItemIndex][1] = UpdateName;
mydsClass.Tables["class"].Rows[e.Item.ItemIndex][2] = UpdateLink;
DataListClass.EditItemIndex = -1;
DataListClass.DataBind();
}
//////////////aspx file ///////////////////////////////
<EditItemTemplate>
<asp:TextBox id=TextBoxName runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.class_name") %>'
EnableViewState="False">
</asp:TextBox>
<asp:TextBox id=TextBoxLink runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.class_link") %>'
EnableViewState="False">
</asp:TextBox>
<asp:LinkButton id="LinkButtonUpdate" runat="server"
CommandName="Update">Update</asp:LinkButton>
<asp:LinkButton id="LinkButtonCancel" runat="server"
CommandName="Cancel">Cancel</asp:LinkButton>
</EditItemTemplate>
thank U for take a look this Message !
/////////////////c# code file
private void DataListClass_UpdateCommand(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
string UpdateName = ((TextBox)e.Item.FindControl("TextBoxName")).Text;//
here i can not get the text that i modified.
string UpdateLink = ((TextBox)e.Item.FindControl("TextBoxLink")).Text;//
it shows the old text .
//somebody
tell me change viewstate,
//but
it dose nothing for me.
mydsClass.Tables["class"].Rows[e.Item.ItemIndex][1] = UpdateName;
mydsClass.Tables["class"].Rows[e.Item.ItemIndex][2] = UpdateLink;
DataListClass.EditItemIndex = -1;
DataListClass.DataBind();
}
//////////////aspx file ///////////////////////////////
<EditItemTemplate>
<asp:TextBox id=TextBoxName runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.class_name") %>'
EnableViewState="False">
</asp:TextBox>
<asp:TextBox id=TextBoxLink runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.class_link") %>'
EnableViewState="False">
</asp:TextBox>
<asp:LinkButton id="LinkButtonUpdate" runat="server"
CommandName="Update">Update</asp:LinkButton>
<asp:LinkButton id="LinkButtonCancel" runat="server"
CommandName="Cancel">Cancel</asp:LinkButton>
</EditItemTemplate>