Type not compatible error

I get the error below on my IIS server but the code and pages work fine on my dev environment.

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The base class includes the field 'Derived_Moodys', but its type (System.Web.UI.WebControls.TextBox) is not compatible with the type of control (System.Web.UI.WebControls.DropDownList).

Source Error:

Line 248:                                                                                          <tr>
Line 249:                                                                                                <td class="reqField"><font style="FONT-WEIGHT: normal; FONT-SIZE: smaller; COLOR: #bf0f0f; FONT-STYLE: normal; FONT-FAMILY: Arial; FONT-VARIANT: normal">Moody's</font></td>
Line 250:                                                                                                <td><asp:DropDownList BorderWidth="1" BackColor="#ffffe1" BorderColor="#9696D9" BorderStyle="Inset" Runat="server" ID="Derived_Moodys" Width="125px"></asp:DropDownList>
Line 251:                                                                                                </td>
Line 252:                                                                                          </tr>

Source File: C:\Inetpub\wwwroot\CMO\Securitytwo.aspx    Line: 250
Who is Participating?
which version of .net are you using?

after you changed the textbox to a dropdownlist and recompiled did you copy the latest .dll to the production web server's bin directory?
do you have another Element in your Code with ID Derived_Moodys??
I've seen this type of error before when the control on the page doesn't match the declaration in codebehind -- i.e when I've changed a control from one type to another during development.

is the control declared as a textbox in the codebehind file Securitytwo.aspx.cs or .vb and not a dropdownlist?
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

vmarriaAuthor Commented:
No there isn't any element in the code or code behind with the id of Derived_moodys.

It was originally a text box but i've changed since then to a drop down list.

I've done a find on the code behind to see if it got changed in the decleration and it has.

There arn't any instances of derived_moods in the code behind in the decleration other then the drop down decleration.

Could it be a compling issue. I've had problems where the code behind wasn't recognised properly on the server. Is there a way to "Complie" on the server?

vmarriaAuthor Commented:
using versino .net 1.1

you know what I didn't do that. <sigh>

thank you i'll try that but i bet you thats what the problem is.

Is there a way for it to complie on the server?
"Is there a way for it to complie on the server? "

not in 1.1 unless you use the production server as your dev environment.
typically you'd have a dev environment and then just fcopy the files required to run the site up to the production server.
vmarriaAuthor Commented:
I was being lazy to copy the entire project to the server from my home takes about an hour. So I was only copying the files that i modified i should have also just coppied the bin Directory also.


I'll let you know if this works (i'm sure it will)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.