Hai
I am having three dropdownlist(Type(Domestic,International),Country ,State)
Based on type(Domestic/international) country will be loaded and based on country state will be loaded
Here if i choose type(International/Domestic) country data is loaded by setting datasource as datatable (Declared in class) with a default value
If i try to select an item in list it will the default item is always selected
While try to get the selected value for db it will set as Default value
How can i get the selected value to db for saving
Example:
Type:International
Country
Select
USA
UK
Indonesia
<asp:DropDownList ID ="DrpDownorigincountry" runat ="server" AutoPostBack ="true" AppendDataBoundItems ="true" OnSelectedIndexChanged="DrpDownorigincountry_SelectedIndexChanged" >
</asp:DropDownList>
Always selected value wiil be select eventhough others are selected
Sample Code
DAL.objresdtfordisplay = new System.Data.DataTable();
DAL.objresdtfordisplay = Rateobjdc.Exec_Select("select Distinct(tblgeoloc_country) from tbl_geographiclocation where tblgeoloc_modeoftransport='" + Transmode + "' and tblgeoloc_transportype ='" + Transtype + "'");
if ((DAL.objresdtfordisplay.Rows.Count > 0) && (DAL.objresdtfordisplay != null))
{
DrpDownorigincountry.DataSource = DAL.objresdtfordisplay;
DrpDownorigincountry.DataTextField = "tblgeoloc_country";
DrpDownorigincountry.DataValueField = "tblgeoloc_country";
DrpDownorigincountry.DataBind();
DrpDownorigincountry.Items.Insert(0, "Select");
}
How can i fire the correponding event
Regards