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?
Sorry about that - I saw that in the original post and didn't notice during my follow-up.
Can you post a sample project demonstrating what you're seeing? I'm surprised that this would occur if you're posting back. You can attach a sample project from the "Options" tab when posting.
The solution I suggested in my first post also applies here - if you use CSS to hide your panel, rather than setting the Visible property, I would expect this issue to no longer occur.
I said in the parent: 2005 vol.3 (or 5.3)
What version of the NetAdvantage toolset are you using?
There is no AJAX in this application. It is an ASP 1.1 application. The tabs used to switch "on" the panel are using postbacks. I would think that after a postback that it would then generate the control as well as all the scripts associated with it, but it doesn't.
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.