I have problem with asp:Dropdownlist. I have a dropdownlist control in Page1.aspx and I want to assign value and Text to dropdown list form Page2.aspx from java script function. I am able to assign values to asp:textbox but not asp:dropdownlist
code is as follow when i call this function BindShipper();
function BindShipper(SearchResultFor, vendorID, localID,companyName, companyAdd1, companyAdd2, companyCity, companyState, companyZip, companyCountry, companyContact, companyComment, companyPhone, companyFax, companyEmail)
{
window.opener.document.Form1.txtShipperComment.val ue = companyComment;
window.opener.document.Form1.txtShipperCompanyName .value = companyName;
window.opener.document.Form1.txtShipperAddress1.va lue = companyAdd1;
window.opener.document.Form1.txtShipperAddress2.va lue = companyAdd2;
window.opener.document.Form1.txtShipperCity.value = companyCity;
//window.opener.document.Form1.ddlShipperState.Items .Add(companyState);
window.opener.document.Form1.txtShipperZip.value = companyZip;
//window.opener.document.Form1.ddlShipperCountry.Ite ms.Insert(0,companyCountry); // where "0" is the value for this selection
//ListItem litShipperState = new ListItem("--Select--","");
//ddlState.Items.Insert(0,litShipperState);
//ddlState.Items[0].Selected = true;
}
--------------------------------
From: Urmal Patel
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>yfHa3eXbzEOtaHi+/omsrg==</Id>