Tuesday, 5 November 2013

Working with ASP.Net DataList

  1. TextBox text changed event (OnTextChanged) handling in Datalist

protected void txtField_TextChanged(object sender, EventArgs e)
{
            // Get the text box.
            TextBox txtAmount = sender as TextBox;
            // Get the DataList item.
            DataListItem DLItem = txtAmount.NamingContainer as DataListItem;
            // Get a field from DataList item/ row.
            HiddenField hfSampleID = DLItem.FindControl("hfSampleID ") as HiddenField;
}

No comments:

Post a Comment