[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

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
  • 3
  • 3
1 Solution
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?
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?

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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?
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)


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now