for(int i=0;i<fieldid.Length;i++)
{
TextBox _text4 = new TextBox();
TextBox hhhh = new TextBox();
_text4.ID = "txt_" + fieldid[i].ToString();
_text4.Width = Unit.Pixel(289);
_CalendarExtenderArray[i] = new AjaxControlToolkit.CalendarExtender();
_CalendarExtenderArray[i].ID = "_CalendarExtenderArray" + fieldid[i].ToString();
_CalendarExtenderArray[i].CssClass = "cal_Theme1";
_CalendarExtenderArray[i].Format = "dd.MM.yy";
// _text4.Attributes.Add("OnClientDateSelectionChanged", "javascript:DateChanged('" + _text4.ClientID.ToString() + "')");
_CalendarExtenderArray[i].TargetControlID = "txt_" + fieldid[i].ToString();
td2.Controls.Add(_text4);
td2.Controls.Add(_CalendarExtenderArray[i]);
_CalendarExtenderArray[i].Attributes.Add("onchange", "javascript:DateChanged('" + _text4.ClientID.ToString() + "','" + _CalendarExtenderArray[i].ClientID.ToString() + "')");
}
I want to add dateSelectionChangedClientEvent to the calander control (_CalendarExtenderArray[i]) for executing javascript function on client side I used above code but I couldn't access the correct Client Id from _text4.ClientID.ToString() property of _text4 . plz help me