Hi,
I am having two drop down lists one is dependent on the other. I pass a
DataSet back to client using AjaxPro and then populate the controlled
DropDownList.
When I select a new item from the populated DDL and click an ASP Update
Button on the form, the selected index shows the previously selected
index. I turned off ViewState of the populated DDL, but didn't work.
Jscript Code:
function updateDateKey(cntrlID) {
var srcDLL = window.event.srcElement;
var val = ViewManager.GetHtmlDLLContacts(srcDLL.value,
cntrlID);
var ddl = document.getElementById(cntrlID);
if(ddl)
{
for(i = 0; i < ddl.options.length; i++)
{
ddl.remove(i);
}
for(i = 0; i < val.value.Items.length; i++)
{
var oOption = document.createElement("OPTION");
ddl.options.add(oOption);
oOption.innerText = val.value.Items[i].Text;
oOption.value = val.value.Items[i].Value;
}
}
return false;
}
Code behind to add Selected index changed of the controlling DDL:
ddlCmpnaies.Attributes.Add("onchange", "return updateDateKey('" +
ddl.ClientID + "');");
Any help would be appreciated
Ihab
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info/
Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
The open source project is now located at
http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxPro
-~----------~----~----~----~------~----~------~--~---