I have a page that potentially has a large number of dynamically generated date ranges (2 sets of TextBox + ImageButton + CalendarExtender fields for each range item.) I realize that the design of the page is not optimal, but it is what was asked for and what I am attempting to provide.
In the process of creating this, I started having very noticeable slowdowns. By the time you have 100 or so, the browsers start timing out on the script (you get the prompt asking you if you want to kill the script because it is taking too long.) After much trial and error and experimentation, I discovered that the problem was, specifically, the many CalendarExtenders. If you built the same exact page and just started the CalendarExtenders with .Enabled=false, the slowdowns went away. It doesn't matter what state (enabled, visible, not created at all, etc) the TextBox or ImageButton are in, if the CalendarExtenders were enabled, the slowdowns would occur.
So, I decided to add a CheckBox to each range field so that I could start them off disabled and then if the user checks the CheckBox, I would client-side enable all of the fields, including the extenders for the selected range item.
For the ImageButtons, this worked fine. I was able to document.getElementById() those fields and enable or disable them.
Using $find() to locate the CalendarExtenders was failing, though. Eventually I discovered that if the CalendarExtenders were enabled when the routine was called, $find() would work, and I could call the .set_enabled() function to disable them. But, if the CalendarExtenders are disabled before calling the routine, $find() fails to find them.
Any ideas how to client-side enable these CalendarExtenders if I can't $find() them? I suppose that one option is to figure out why I can't pass the extenders as objects (so I don't have to try to look them up) but I'm stuck there, too.