469,927 Members | 1,464 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

why does the ASP dropdownlist not work when binding?

I have placed a dropdown list in the edititemtemplate of a formview control and followed specific MSDN instructions on how to bind the list source to a separate SQL lookup data source but have the formview bound to the main data source. If I set the selecteditem value to bind to the formview control I always get the following error:
'DropDownList2' has a SelectedValue which is invalid because it does not exist in the list of items.

This is my asp:
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource2" DataTextField="Type"
DataValueField="Type"
selectedvalue='<%# Bind("ServiceProviderType") %>'>
</asp:DropDownList>
I have read over 50 posts on this and got nowhere - HELP!
Oct 9 '09 #1
4 3045
CroCrew
564 Expert 512MB
Hello garyhumf7,

From my understanding this is a "Classic" ASP forum. Your question should be posted in the ".NET" section.

Sorry,
CroCrew~
Oct 9 '09 #2
jhardman
3,406 Expert 2GB
@CroCrew
You are correct, this definitely is a "ASP.NET" question, and doesn't belong in the "classic ASP" forum.

I have moved it over for you.

Jared
Oct 9 '09 #3
Thanks - please bear with the newbie.
Oct 11 '09 #4
Frinavale
9,735 Expert Mod 8TB
Is there a "ServiceProviderType" in your data source?

-Frinny
Nov 9 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Christian | last post: by
reply views Thread by Goncalo Faria | last post: by
2 posts views Thread by Shiju Poyilil | last post: by
reply views Thread by jonathanyan | last post: by
10 posts views Thread by ads | last post: by
5 posts views Thread by Mike | last post: by
2 posts views Thread by needin4mation | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.