I have an ASP.NET web form making an ajax request to a service which returns some html to inject into the page. The service dynamically renders a usercontrol to a string which is the html returned. In the usercontrol we have a WebDateChooser. The WebDateChooser is rendering just fine, but none of the client side events are firing to display the calendar. The same thing is happening for the WebDateTimeEdit control as well. Below is a snippet we use to render the usercontrol to a string, which gets returned to the client and injected into the page:
Page pageHolder = new Page(); UserControl viewControl = pageHolder.LoadControl("~/path/to/control.ascx") as UserControl; pageHolder.Controls.Add(viewControl); StringWriter output = new StringWriter(); HttpContext.Current.Server.Execute(pageHolder, output, false); return output.ToString();
When i put a WebDateChooser right into a normal page i see a bunch of WebResource.axd requests which pull in necessary js for the control. I'm not seeing this with the dynamic rendering we are doing, but I don't know how to force these scripts to load(or manually load them myself). Any help is appreciated.
Kyle
Hi Kyle,
If you still need assistance on the matter, please do not hesitate to ask.
Hello Kyle,
It has been some time since your post but in case that you still need assistance I will be happy to help.
I suggest that you try to register the javascript files used by WebDateChooser in your project. Information on how to access javascriptscript files directly can be found here - http://blogs.infragistics.com/blogs/craig_shoemaker/archive/2009/11/09/accessing-infragistics-javascript-files-directly.aspx.
If you need any further assistance on the matter please do not hesitate to ask.