问题易解决:
protected void Button2_Click(object sender, EventArgs e)
{
DataListItem item = (DataListItem)(((Control)sender).NamingContainer);
int i = item.ItemIndex;
string num = ((TextBox)DataList1.Items[i].FindControl("txtnum")).Text;
}