Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6620243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:04:24+00:00 2026-05-25T21:04:24+00:00

I’ve been stuck on the same DropDownList problem for days now while working on

  • 0

I’ve been stuck on the same DropDownList problem for days now while working on a MVC project in VS2010. The problem has become even more frustrating right now because when I copy all relevant code into a completely new, blank project, the second instance actually runs perfectly and produces exactly the result I expect…

Controller:

<HandleError()> _
Public Class HomeController
    Inherits System.Web.Mvc.Controller

    Function Index() As ActionResult
        ViewData("Message") = "Welcome to ASP.NET MVC!"

        Return View()
    End Function

    Function About() As ActionResult

        Dim configList As List(Of String) = New List(Of String)
        configList.Add("10GBaseLX4")
        configList.Add("10GFC")
        configList.Add("10GigE")
        configList.Add("100BaseFX")
        configList.Add("Test")

        ViewData("cprotocols") = New SelectList(configList)
        Return View()

    End Function
End Class

View:

<%@ Page Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="aboutTitle" ContentPlaceHolderID="TitleContent" runat="server">
    About Us
</asp:Content>

<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>About</h2>
   <p>
        <% Using Html.BeginForm()%>
        <%= Html.DropDownList("cprotocols") %>
        <% End Using %>
    </p>
</asp:Content>

The page doesn’t do anything right now other than simply display a dropdownlist with the options shown hard-coded in the controller, but I’m not even going to bother with writing logic when my current site refuses to even show the list to the user.

The error message is There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'cprotocols'. but once again, there are no runtime errors when i copy this bit of code over to a blanked solution.

Any ideas how to solve this or even any clues on what is causing such an inconsistency? I don’t want to copy over all the other files from my current project into the new one just to have the problem manifest itself again somewhere down the line (which is bound to happen when the code is only half broken…)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:04:24+00:00Added an answer on May 25, 2026 at 9:04 pm

    Turns out it was a problem with the module; the code itself is fine. I had to delete Temporary ASP.NET files, clean up my GAC, as well as nuke all current assembly references in my project, clean solution, re-add required references, and finally clean and rebuild. I’m still not clear on why exactly VS2010 was referring to assemblies from an old build (simply cleaning and rebuilding is not enough). I also don’t know at what point the environment stops “refreshing” and decides to simply refer to obsolete builds. I’ll try to do a bit more research on this point and then add on to this post.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am currently running into a problem where an element is coming back from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.