Jitendra Patel

Jitendra Patel

  • NA
  • 149
  • 0

How to Get child control In Datalist?

Apr 8 2011 3:28 AM

Hi,
How to use child control Events in Datalist.

I have send u my code please refer it and rep.

Button imgButton = new Button();
  imgButton = (Button)sender;
  DataListItem row = default(DataListItem);
  
  row = (DataListItem)imgButton.NamingContainer;
  int index = 0;
  index = row.ItemIndex;
  int i = 0;
  
  Label hdnId = new Label();
  hdnId = (Label)row.FindControl("lblid");

  i = hdnId.Text;
  Label lblNmae = new Label();
  lblNmae = (Label)row.FindControl("Label1");
  string iname = null;
  iname = lblNmae.Text;
Thanks,
Jitendra Patel


Answers (4)