.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Dropdownlist error: SelectedValue which is invalid because it does not exist in the list of items.

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :ASP.Net

I have a dropdownlist in a detailsview edit Item template. Also I have two tables - Employee and Main. In the Employee table I have column EmpId and AssignedTo. In the main table I have EmpId which is connected to the Employee table. 

The detailsView has a label which shows the AssignedTo name for a particular record and it works fine. But if I click the edit button to shwo the dropdownlist in the editItemTemplate it is givig me the above error.

The code is:

<asp:DetailsView ID="dtvAssign" runat="server" AutoGenerateRows

View Complete Post

More Related Resource Links

'Dropdownlist' has a SelectedValue which is invalid because it does not exist in the list of items


I have a dropdown list that has a bind on it and I get this error. Why am I getting this error and what can I do to fix it. here is the code for the dropdown I currently have:


 <asp:DropDownList  ID="DDLPreferred" AppendDataBoundItems="true" SelectedValue='<%# Bind("PREFERRED_COMMUNICATION") %>'  runat="server" TabIndex="15">
                <asp:ListItem Text="none" Value=""></asp:ListItem>

				<asp:ListItem>Home Phone</asp:ListItem>
				<asp:ListItem>Work Phone</asp:ListItem>
				<asp:ListItem>Cell Phone</asp:ListItem>


'DropDownList6' has a SelectedValue which is invalid because it does not exist in the list of item


In my asp.net page I have a formview.  In the formview's InsertItemTemplate I declare a dropdown list as below:

                                    <asp:DropDownList ID="DropDownList6" runat="server" text='<%# Bind("District") %>'
                                    DataSourceID="SqlDataSource6" DataTextField="District"

Error Tab / List that does not exist

I am setting up a new deployment of Sharepoint 2007.Somebody else started the deployment and setup a http://server/sites/docssite as a colloboration site.I want to serve from the root and make that a 'home' portal for thecompany, so I setup a Collaboration Portal on '/'.Now if i go to 'https://server', it takes me to 'https://server/Pages/Default.aspx' and shows the collaboration portal. The first tab is thename of the company, but the second tab says 'Error'. If i hover overthe error tab, it shows this error message:---An error occured while rendering navigation for requested URL: /.Exception message: List does not existThe page you selected contains a list that does not exist.  It mayhave been deleted by another user. Stack trace:    atMicrosoft.SharePoint.Library.SPRequest.GetListsWithCallback(StringbstrUrl, Guid foreignWebId, String bstrListInternalName, Int32dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData,Boolean bSecurityTrimmed, Boolean bGetSecurityData,ISP2DSafeArrayWriter p2DWriter, Int32&amp; plRecycleBinCount)  at Microsoft.SharePoint.SPListCollection.EnsureListsData(GuidwebId, String strListName)  at Microsoft.SharePoint.SPListCollection.EnsureListsData(StringstrListName)  at Microsoft.SharePoint.SPListCollection.ItemByInternalName(StringstrInternalName, Boolean bThrowEx

Invalid URL error on InfoPath Form Publish on an External List

I am using SP2010 Enterprise on Windows 7 and SPD 2010 & InfoPath 2010 all on the same machine in test.  I create an External List based on a ECT and Click on the 'Design Forms in InfoPath' icon and 'Item' which drops down from it.  That launches InfoPath Designer 2010 & downloads the form from http://<site>/lists/<mylistname>/Item/template.xsn and sets you up in an edit session.  I can make changes on the form but when I publish via File | Publish | External List (Publish Form To An External List) I get a save prompt for local copy & then an error: The following URL is not valid: http://<site>/lists/<mylistname>/Item/template.xsn  (same URL as it started with during the initial download). I took screen shots of the messages to make sure. Some things I have tried & observations: If I change to an internal Custom List the publish step (to list not external of course) works just fine. I also ran this test launching SPD as Administrator with no difference.  I stopped the System Event Notification service per http://serena-yeoh.blogspot.com/2006/08/infopathformurlnotvalid.html  'net stop sens' with no difference Any ideas are welcome. BTW I notice that this step of launching the InfoPath designer does change the form on the list in Sharepoint albeit slightly -

Error : List doesn not exist


Hello Everybody , 

i have the following error every time i try to upload or add a document in my document Center site and i would like to fix it ; 

i am running a sharepoint 2010 installed on a windows 2008 connected to sql server 2008 ; and i am logon uing the admin account;

Error :

List does not exist.

The page you selected contains a list that does not exist.  It may have been deleted by another user.


Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: 4b2b6b11-e973-4bf1-9369-2fea6134e8de

Date and Time: 10/6/2010 11:21:25 AM


any help would be appreciated


Thank you




DropDownList error message: "value not found in the list"


Inside a FormView control, I have a DropDownList that populates a SQL column with city names. The SQL column type is nchar(50) -- I set it for 50, since the city names can be short or very long. The DropDownList contains all the city names. When a new record is created in SQL via this FormView control, the DropDownList successfully populates the column cell.

However, when I try to edit that record (using the edit template in FormView), I get the above error message...I believe the retrieved entry is not matching the entry in the list, because SQL isn't just storing the number of characters that a given city has (say "6" for Boston), it is storing/retrieving 50 characters (6 + 44 null spaces = 50 characters)--and thus DropDownList doesn't recognize that the entry is just "Boston"...How can I resolve? How can I ensure that there are no extra spaces recorded in a SQL cell beyond what is needed to accomodate the name of any given city?  Is this a SQL task or can it be resolved in ASP.NET?  Thank you. 

DropDownList - Selected Value not in List Error.


If you use a dropdownlist and the selected value for the ddl is not in the datasource.  This can happen in an existing record if the user changes the datasource, e.g. deletes a row.  ASP.net throws an exception.

To get around this problem, you can not bind the SelectedValue in the aspx page and use code like the following in the FormView_DataBound Event. 

'-- Set DropDownList - Selected Value
      If Me.FormView1.CurrentMode = FormViewMode.Edit Then
         Dim ddl1 As DropDownList = Me.FormView1.FindControl("ddlTest")
         If Not IsDBNull(ddlTest) Then
            Dim strValue As String = (DataBinder.Eval(FormView1.DataItem, "DataFIeldName").ToString())
            If ddl1.Items.IndexOf(ddl1.Items.FindByValue(strValue)) >= 0 Then
               ddl1.SelectedValue = DataBinder.Eval(FormView1.DataItem, "DataFieldName")

How to get list of VALUES (not items) from a dropdownlist?


Hello all.  I see that dropdownlist has an "items" property to get the list of displayed items for a dropdown, but it doesn't seem to have an equivalent property for getting the "values" associated with the items.  For example, I may have a dropdown that displays "High", "Medium" and "Low", but returns values of "H", "M", "L".  How can I easily get that list of HML?

Thanks for any help!


Error "List does not exist" trying to insert pictures or links from Content Editor WebPart


I have put a Content Editor WebPart on a page and I'm trying to insert a picture from the Rich text editor, but whenever I try this I get this error:

List does not exist.

The page you selected contains a list that does not exist. It may have been deleted by another user.

This also happens when inserting links. When I use Fiddler I can see that the error occurs somewhere in AssetPortalBrowser.aspx and It's likely that the last location used to insert pictures and links no longer exist. So the question is how do I reset the location to point to a list on the current site, or any other list for that matter? I tried deleting and adding the WebPart on the page without any luck. Typing in a valid link in the link text box or setting the attribute "DefaultToLastUsedLocation" to "false" in the call to AssetPortalBrowser.aspx did not work either. I read the solution at http://mossipqueen.wordpress.com/2008/08/08/assetportalbrowser-error-list-does-not-exist/ (de- and re-activate Office SharePoint Server Publishing feature) but the feature is not activated on my web. Does anyone have a tip on what to do? This happens on a live SharePoint environment so there may be some restrictions as to what I can

DropDownList in DetailsView, invalid SelectedValue


I believe my question is not new here, but I think it is valuable because there are so many results from google with the 'dropdownlist in detailsview' as keywords.

Well, my question is described as below. (ASP.net and C#)

1)  I need a detailsview to add and edit record of table T1, which contains products information. T1 has a field 'catalog' which indicates the catalog of the product. All possible catalogs is stored in table T2. The simplified tables is described in 2)

2)  Simplified tables:

  • T1 fields: id, prodname,  catalog;  which is the datasource of the DetailsView.
  • T2 fields: id, catalog; which is the datasource of the dropdownlist in the detailsview.
  • all record of T1 have a catalog, which is picked up from T2.

3)  Functions I need are:

  • when detailsview in edit mode and insert mode, the field catalog should turns from a textbox to a dropdownlist which contains the catalogs stored in T2 .
  • when the item(catalog) of dropdownlist is selected and the 'update' button is clicked, the selected catalog (from T2) should replace the exist one of T1.

4)  My procedures to achieve the functions were:

  • drag and drop a detailsview control to a page, bind a datasource to it, en

Import-SPWeb, List does not exist error

I have a strange problem with custom lists in an imported site.
After exporting the site in Central Admin by clicking "Export a site or list" and importing it with "Import-SPWeb" (on a different farm), I cannot read or create new items in custom lists in the imported site. However, by code, i.e. using PowerShell or custom Web Parts, I can read items in the list without any problems.

If I click on any item in a list however, I get an error saying "List does not exist. The page you selected contains a list that does not exist.  It may have been deleted by another user."

I guess it has something to do with permissions, since I get an "Access denied" error when trying to create new items through the browser. The permissions settings seem fine in the browser though...

EDIT: This seems to occur only on lists where I have created custom list forms, like Disp and Edit pages. I guess it has something to do with these files. Are any one else having the same problem?

EDIT 2: Correction, this occurs on every list.

Error: "List does not exist"



i have a problem with the list, there is 1 list where user was getting error "List Does not Exist", so  i have given contribute access to that user, user started using this list without any problem. after couple of weeks user came back with the same proble, i checked permission for this list, this list has 1 group visitor group and thsi group has contribute access, user is already added into this, but still user is getting "Lst Does not exist" error page.

How to bind the selectedvalue from asp.net dropdownlist to list



Sharepoint Designer 2007:

How can i bing data from asp.net contorl dropdownlist (selectedvalue) to list.

Thank you

jQuery: Styling DropDownList Alternating Items (Rows)

In the following example, I will show how you can style any asp:dropdownlist very easily.

The example demonstrates how you can change alternating row items background color, using the fadeTo() to add a nice touch in the dropdownlist. You can change alt rows with a couple lines.

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

DropDownList within FormView Error

I have a FormView which works find and I have added a new DropDownList within the form which references another table to which I need to select a value,
I have added the dropdownlist2 and setup a new connection string to this, when I run the page I get this error:

Could not find control 'DropDownList2' in ControlParameter 'CurrencyID'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'DropDownList2' in ControlParameter 'CurrencyID'.
any help would be greatly
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend