I have NetAdvantage 2005 Vol.3 and I have an application we inherited from someone else. In there, we have a user control where we have a couple of WebDateChoser controls. The problem is that the controls don't render correctly. When you click on the control, nothing happens. You can manually type in the date, but you can't get the pop up to come up. Looking at the code generated, none of the javascript references are included among other things.
One thing I discovered is that if I include a WebDateChooser control in the parent page of the control, the controls in the user control will then work correctly.
So, how do I get this to work right?
As an update, the control is on a panel that is not visible at load time. If I set it visible the control renders correctly. If it is hidden and is later set to visible, the control doesn't render correctly.
Are your WebDateChooser controls placed in an AJAX-enabling control, such as UpdatePanel or WebAsyncRefreshPanel?
When you set a control's Visible property to false, it doesn't get rendered. to the client This is more than making the control "not visible" - as far as the browser is concerned, the control doesn't exist.
If your WebDateChooser controls are in an AJAX-enabling control, then only the contents of that control are likely being refreshed. This means that, even though the WebDateChooser controls are now visible, the links to their JavaScript aren't sent, because those SCRIPT elements are rendered to the HEAD element of the page.
You might consider using the CSS "display:none" or "display:hidden" style to hide the control, rather than setting the Visible property to false. This will mean that your panel will be rendered to the client, and will be initially hidden from view. Then, rather than setting Visible to true, clear the "display" style using JavaScript to make the panel (and the WebDateChooser controls) appear to the user. All functionality should be intact at this point; the only downside is that it will take a little longer to render your page when the controls are hidden.