Link to home
Start Free TrialLog in
Avatar of dotnetuser07
dotnetuser07

asked on

How to intialize dropdownlist with Session variable in a formview control

Hi,

   I have one question on asp.net formview control.
I have a formview control on my webpage. It has a dropdown list. I am populating it with data coming from database. Also, the dropdown list should have one more value in the list which is coming from session variable(from another page) and that should be the default value for the ddlist. I can populate the dropdown vid the data from database. But i donno how to add the session value in the dropdown list.
 Can i have suggestions.

Thanks
Avatar of y0usuf
y0usuf

After binding dropdownlist from database.
You can add the item from session by

dropdownlist.items.add(new listItem(session("DropDowlistItemToAddText"),session("DropDowlistItemToAddValue")))
ASKER CERTIFIED SOLUTION
Avatar of y0usuf
y0usuf

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