Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi guys i have a custom dropdownlist control:

MIDL
public void Bind<T>(IEnumerable<T> dataSource, string valueField, string textField)
       {
           DataSource = dataSource;
           DataValueField = valueField;
           DataTextField = textField;
           DataBind();

}

but when i use javascript to get the selectedindex of the control and set another custom dropdownlist's selectedindex to that of the first selected one, it does not change!

javascript code:

C#
function test()
   {
       var drpCampaignType = document.getElementById('<%=drpCampaignType.ClientID %>');
       var drpCampaignTypeValue = drpCampaignType.selectedIndex       
var drpListCampaignDocketTemplate = document.getElementById('<%=drpListCampaignDocketTemplate.ClientID %>');
       var drpListCampaignDocketTemplateValue = drpListCampaignDocketTemplate.selectedIndex;
       var drpCampType = document.getElementById('<%=valueOffPurchRequiredFieldValidator.ClientID %>').selectedIndex= drpCampaignTypeValue;
       var drpCampDockTemplate = document.getElementById('<%=valueOffPurchRequiredFieldValidator.ClientID %>').selectedIndex= drpListCampaignDocketTemplateValue;



is there any way to overcome this, thanks in advance!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900