Event Firing??
-
Hi i am developing a web app using asp.net and c#, on a page i have 2 cols of dropdown lists the left filled with player names and right filled with possible heights. when a player is selected theres a postback to find and select the appropriate height for the selected player but the problem is there are 14 players ddls and 14 heights ddls all linked to the same function. but the problem is if no height is available for the selected player then N/A is selected in the heights ddl and the user can then choose the correct date from the ddl available but when i try to save the players details to the database the event to find the correct height is fired and then players height is reset to N/A... if anyone has an ideas or suggestions i would really appreciate them thanks in advance Tim private void player_SelectedIndexChanged(object sender, System.EventArgs e) { DropDownList ddlPlayer = sender as DropDownList; string number = ddlPlayer.ID.Substring(ddlPlayer.ID.IndexOf("homeName")+8); //*** create person object for height details DAL.ObjectAccess.Person oPerson = new DAL.ObjectAccess.Person(); oPerson.ID = new SqlInt32(Convert.ToInt32(ddlPlayer.SelectedValue.Substring(0, ddlPlayer.SelectedValue.LastIndexOf(":")))); oPerson.SelectOne(); //*** select correct height from ddl DropDownList ddlHeight = (DropDownList)this.FindControl("height" + number); if(ddlHeight != null) { ddlHeight.SelectedValue = oPerson.Height.Value.ToString(); } //*** display age on label Label lblAge = (Label)this.FindControl("homeSquad" + number); if(lblAge != null) { lblAge.Text = ddlPlayer.SelectedValue.Substring(ddlPlayer.SelectedValue.LastIndexOf(":")+1); } }