Dropdownlist with array

Posted by Saritha.rajeshkumar under C# on 4/26/2011 | Points: 10 | Views : 1764 | Status : [Member] | Replies : 2
hi this is saritha,
i have used array in dropdownlist, when i select the value in dropdownlist and trying to insert in database, only the first value is taking in database not the selected value.




Responses

Posted by: Ndebata on: 4/26/2011 [Member] Starter | Points: 25

Up
0
Down
Try to bind the dropdownlist in when it is not a postback
What i mean just check a condition before assigning the array in this case

if (!IsPostBack)

{
//DropDownList1.DataSource = _array;
//DropDownList1.DataBind();
}


Saritha.rajeshkumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tijut2k on: 4/26/2011 [Member] Starter | Points: 25

Up
0
Down
How did you bind DataValueField and DataTextField,please check these properties when u bind the dropdownlist

Best Regard's
Tiju Thankachan

Saritha.rajeshkumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response