Greetings, all.
I'm faced with a peculiar problem. I have created a form that enables an administrator to select an office location to a particular staff member.
All he has to do is chose the country from a drop down list, which automatically populates another drop down list containing the cities for that particular country.
Please note: this is not actually mandatory and null values may occur.
The problem happens when the administrator is trying to UPDATE this information.
I created an event that automatically loads a hidden variable with the value of the country dropdown. If it is null, then a " - select - " option will appear at the top.
So far, so good. The issue that I have is that I MUST databind the city id to the corresponding city drop down. This works fine as long as an office city already exists.
Or if the city is in the same country. The moment I change the country drop down (thus changing the city drop down) then it breaks, giving me the following error:
A critical error has occurred.
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
And, if the city value is empty, I get the following error:
A critical error has occurred.
'DIR_DutyStationID' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value
Any suggestions?
Many, many thanks in advance!
L