473,698 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why does the ASP dropdownlist not work when binding?

2 New Member
I have placed a dropdown list in the edititemtemplat e 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:DropDownLi st ID="DropDownLis t2" runat="server" AutoPostBack="T rue"
DataSourceID="S qlDataSource2" DataTextField=" Type"
DataValueField= "Type"
selectedvalue=' <%# Bind("ServicePr oviderType") %>'>
</asp:DropDownLis t>
I have read over 50 posts on this and got nowhere - HELP!
Oct 9 '09 #1
4 3238
CroCrew
564 Recognized Expert Contributor
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 Recognized Expert Specialist
@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
garyhumf7
2 New Member
Thanks - please bear with the newbie.
Oct 11 '09 #4
Frinavale
9,735 Recognized Expert Moderator Expert
Is there a "ServiceProvide rType" in your data source?

-Frinny
Nov 9 '09 #5

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

Similar topics

0
4788
by: Shane O. Pinnell | last post by:
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a datagrid populated from a dataset. I have a TemplateColumn with a DropDownList (DDL) in the FooterItemTemplate that is populated in the Page_Load event using a Sub Routine as the DataSource of the DDL. The FooterItemTemplate's DDL populates as expected when the DataGrid's DataBind method is called. ...
2
1888
by: Christian | last post by:
Hi, I have a datagrid on an ASP.NET page, which has a custom columntemplate. In this columntemplate I would like to have a DropDownList, which is shown, when the user edits the record. However, I can't manage to bind the DropDownListField to the underlaying dataset, so it shows the contents of the underlying database field.
0
1160
by: Goncalo Faria | last post by:
Hi. I'll go directly to my problem: I have a repeater that is binded with data. For each data row I want the user to be able to change a field, that is represented by a DropDownList. My problem is that when binding the DropDownList I am not
2
3048
by: Shiju Poyilil | last post by:
Hi ! I have a requirement wherein i am binding a datalist which contains a label (Caption for the field) and some literal hidden fields and a dropdown list. When I am binding to the datalist.. only the labels (caption) and the invisible literal controls are binded.. Now based on the invisible literal control values I get the information from DB to bind it with each dropdown list (I am doing this in the item databound event) Also based on...
0
1037
by: jonathanyan | last post by:
Hi all: I am dynamically creating two dropdownlist controls in a user control, the data of the second dropdownlist control depends on the selected value of the first dropdownlist control, the first dropdownlist control has a post back event, in which it will bind the data to the second control based on the selected value of the first control. Both auto postback and data binding work fine, but when I tried selected a value in the second...
10
6376
by: ads | last post by:
hi, after binding the dropdownlist to a datasource, ive experience this error "Cannot have multiple items selected in a dropdownlist" after using the code: dropdownlist.items.findbyvalue("value").selected = true I didnt specify any selected item in the dropdownlist during binding to the datasource. I use dropdownlist.clearselection() but still error occurs. I need information on this. Thanks. Ads
5
17167
by: Mike | last post by:
In ASP.NET 2.0 I have a dropdownlist populated from a sqldatasource. The dropdownlist values are successfully populated from a database table. I would like to add the value "Select Company" which will be the selected value when the page loads. I attempted to use the code below to add "Select Company" dynamically but it is not added. Only the values from the database are in the dropdownlist. I also tried to added it to the dropdownlist...
2
1291
by: needin4mation | last post by:
I remember in 1.1 that I would put not to populate a given dropdownlist unless it was not Page.IsPostBack. But in 2.0 where I use the DAL and no codefile, I don't see where to effect this. Any help is appreciated. I want my dropdownlist to keep what the use selected when the page refreshes. Thanks.
1
2281
by: ken_wilsonii | last post by:
I ran into this problem it ended up being a combination of this that needed to be done. I believe this will work for a bound list to. The whole problem stems from the two-way binding which has caused me several other headaches. My example is derived from binding a DETAILSVIEW to a SQLDATASOURCE. The field is then converted to a template field for which I modify the EditTemplate for that
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.