Link to home
Start Free TrialLog in
Avatar of jfsedlar3rd
jfsedlar3rdFlag for United States of America

asked on

asp.net Dropdown list no selected item in code behind.

I have been beating my head on the desk. I am writing a asp.net app in Visual Studio 2010 I filled a dropdown list via a SQL 2008 table the same way i do in Visual Studio 2008. The ddl populates fine however when I punch a save button the selected value is not available in the code behind. I am using master pages.
Avatar of niralshah
niralshah
Flag of India image

On click your page gets post back so it will again populate your dropdown so you won't get selected value of the same. You can place the control in Updatepanel which will stop page postback and you get control's value
Avatar of jfsedlar3rd

ASKER

Why have I not seen this functionality in the past? is there something not configured right with my viewstate?
ASKER CERTIFIED SOLUTION
Avatar of niralshah
niralshah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Duh I forgot the  If Not IsPostBack. Thanks a lot.