U
Urmal Patel via .NET 247
I have problem with aspropdownlist. 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.value = companyComment;
window.opener.document.Form1.txtShipperCompanyName.value = companyName;
window.opener.document.Form1.txtShipperAddress1.value = companyAdd1;
window.opener.document.Form1.txtShipperAddress2.value = 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.Items.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;
}
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.value = companyComment;
window.opener.document.Form1.txtShipperCompanyName.value = companyName;
window.opener.document.Form1.txtShipperAddress1.value = companyAdd1;
window.opener.document.Form1.txtShipperAddress2.value = 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.Items.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;
}