>How can I refer to controls in itemTemplate? > > > >in CustomValidator1_ServerValidate, I need to refer to TextBox1 to do validation. >
Try something like:
// Replace grdTemplate with the name of your grid, assuming it's even on a grid.
TextBox text = this.grdTemplate.Rows[this.grdTemplate.EditIndex].Cells[0].FindControl("TextBox1") as TextBox;