Hi guys,
I wondered if anyone could help me with this problem, or even shed some light on the direction I need to take to resolve it? I'm using .NET 2.0 (C# flavor) to build a large user-based website.
I've created an AJAX based user control, which is dynamically placed on a page (once, or multiple times) if the user has the correct permissions to receive it.
It contains two drop down lists - employee value and partner value; and a further date of birth selection user control which holds three additional drop down lists containing day, month and year.
I've managed to make the employee and partner value dropdowns dynamically update a value field via AJAX whenever the onchange event is called (again which has to be created dynamically as there can be multiple user controls on one page and I use ClientID to retreive the correct ID of the element). It passes the values of the five fields via a pipe delimited string list (eg: 500|10|2006|08|30) to the AJAX and it updates. Successfully, I'm pleased to add.
However, I'm having difficulty making the same onchange events of the date user control also update the value via AJAX. Despite passing the same code to use each of the date drop down lists, I receive an Javascript error telling me that the ID of the employee value (the first item called in the onchange event) does not exist. I can see it on the page, it is exactly the same event and calls the same name as the employee dropdown, yet it says it doesn't exist.
I think this error is something to do with how the date field in a separate User Control is unable to wire up to the Employee/Partner dropdown values to process the script, even though in Source mode the object exists. The Javascript error I'm receiving is:
Error: ctl00_cphContent_ctl00_ctl00_ddlEmployeeValue is not defined
Source file: http://computername/WebResource.axd...0yJ-T9vcwP8T9_KFWtOLGHQ1&t=632961828600156250
Line: 97
This line in WebResource is within 'function ValidatorHookupEvent(control, eventType, functionPrefix)'
Has anyone got any ideas, or explanation as to why this is happening?
I wondered if anyone could help me with this problem, or even shed some light on the direction I need to take to resolve it? I'm using .NET 2.0 (C# flavor) to build a large user-based website.
I've created an AJAX based user control, which is dynamically placed on a page (once, or multiple times) if the user has the correct permissions to receive it.
It contains two drop down lists - employee value and partner value; and a further date of birth selection user control which holds three additional drop down lists containing day, month and year.
I've managed to make the employee and partner value dropdowns dynamically update a value field via AJAX whenever the onchange event is called (again which has to be created dynamically as there can be multiple user controls on one page and I use ClientID to retreive the correct ID of the element). It passes the values of the five fields via a pipe delimited string list (eg: 500|10|2006|08|30) to the AJAX and it updates. Successfully, I'm pleased to add.
However, I'm having difficulty making the same onchange events of the date user control also update the value via AJAX. Despite passing the same code to use each of the date drop down lists, I receive an Javascript error telling me that the ID of the employee value (the first item called in the onchange event) does not exist. I can see it on the page, it is exactly the same event and calls the same name as the employee dropdown, yet it says it doesn't exist.
I think this error is something to do with how the date field in a separate User Control is unable to wire up to the Employee/Partner dropdown values to process the script, even though in Source mode the object exists. The Javascript error I'm receiving is:
Error: ctl00_cphContent_ctl00_ctl00_ddlEmployeeValue is not defined
Source file: http://computername/WebResource.axd...0yJ-T9vcwP8T9_KFWtOLGHQ1&t=632961828600156250
Line: 97
This line in WebResource is within 'function ValidatorHookupEvent(control, eventType, functionPrefix)'
Has anyone got any ideas, or explanation as to why this is happening?