Unable to cast object of type 'asp.usercontrols_....._ascx' to type 'usercontrols_.....'

M

marshausk

"InvalidCastException was unhandled by user code" is the title of the
error. It's related to 2 different user controls on my page that are
dynamically loaded. I've added both the Register and Reference
statements. The error comes and goes randomly. Today I'm working on
the containing page and haven't done any work in either user control.
The only way I can get the code to run successfully is to make a change
to all 4 files - the 2 user control ascx files and their corresponding
code behinds. If I make a change to just one set of files the error
occurs in the other. If I make a change to the 2nd set it tells me it
can't cast the first. Nice endless loop. What makes it worse is we're
using VSS so the files with the errors are sometimes checked out by
other users and my development effectively stops.

Makes for a painful day of coding. Please help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top