you can add onmouse over event to the dropdownlist from codebeinhd in Page_Load event like this
<pre lang="c#"> ddlsample.Attributes.Add("onmouseover", "OnDDLFocus();");
Now in JavaScript you can bind data to the dropdownlist like this
var ddlCountries;
function OnDDLFocus() {
ddlCountries = document.getElementById("<%=ddlsample.ClientID %>");
ddlCountries.options.length == 0;
AddOption("Loading", "0");
PageMethods.getElemnts(OnSuccess);
}
function OnSuccess(response) {
ddlCountries.options.length = 0;
AddOption("Please select", "0");
var availableArray = response;
for (var i = 0; i < availableArray.length; i++) {
AddOption(i, availableArray[i]);
}
}
function AddOption(value,text) {
var option = document.createElement("option");
option.Text = text; option.Value = value;
ddlCountries.options.add(option);
option.innerText = text;
}
Also refer this link for complete details
http://forums.asp.net/t/1812012.aspx/1[
^]