...

View Full Version : Problem in getting selected value from dropdownlist when using Array as datasource



PradipCNair
04-27-2006, 03:12 PM
Hi All,
I have used a string array as datasource for a dropdownlist. When getting the selected value from the dropdownlist in the postback, I am getting always the first value even though some other item is selected. Can any one help me to find a soultion for this problem? :confused:

NuneatonSam
04-27-2006, 05:03 PM
When you submit the page its posting back, rebinding the drop down list. Simple put "If Not IsPostBack then" into your page load, something like below.

Sub Page_Load()
If Not IsPostBack Then
Page Load Stuff
End If
End Sub

handshakeit
04-28-2006, 07:15 AM
how r u taking selected value from dropdownlist
try this

Response.Write(DropDownList1.SelectedValue);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum