473,382 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

strange problem with inherited controls

I have a strange problem with inherited controls:

I have created two user controls called UserLoginA & UserLoginB.
One of the properties of these controls is of type UserGroup ( a class I
defined in another assembly).
Then I show that UserLoginA & UserLoginB have a lot of common code,
so I decided to inherit UserLoginB from UserLoginA.
So I Created a new user control UserControlC that inherits from UserLoginA,
added the code needed to make it work like UserLoginB, tested it, and
everything worked just fine.
Then I removed the file that defined UserLoginB from the project, and
renamed UserLoginC to UserLoginB (so I will not have to change all the code
using UserLoginB).
Then the strange stuff started:
Now when I try to drag UserControlB (that used to be UserControlC) on a from
I get this error:

Then I create an inherited user control called UserLogin2 that inherits from
UserLogin.
When I add these controls to the toolbox and try to drap UserLogin2 to the
form
I get an error:
An exception occured while trying to create an instance of UserLoginB. The
exception was "The type serialized in the .resources file was not the same
type that the .resources file said it contained. Expected "UserGroup" but
read ""UserGroup".".

Does anybody have any Idea why this happens?

Thanks,
Nadav.
Nov 16 '05 #1
1 1764
Delete the directory "obj" and compile the project again

"Nadav" <Na***@discussions.microsoft.com> schrieb im Newsbeitrag
news:AF**********************************@microsof t.com...
I have a strange problem with inherited controls:

I have created two user controls called UserLoginA & UserLoginB.
One of the properties of these controls is of type UserGroup ( a class I
defined in another assembly).
Then I show that UserLoginA & UserLoginB have a lot of common code,
so I decided to inherit UserLoginB from UserLoginA.
So I Created a new user control UserControlC that inherits from UserLoginA, added the code needed to make it work like UserLoginB, tested it, and
everything worked just fine.
Then I removed the file that defined UserLoginB from the project, and
renamed UserLoginC to UserLoginB (so I will not have to change all the code using UserLoginB).
Then the strange stuff started:
Now when I try to drag UserControlB (that used to be UserControlC) on a from I get this error:

Then I create an inherited user control called UserLogin2 that inherits from UserLogin.
When I add these controls to the toolbox and try to drap UserLogin2 to the
form
I get an error:
An exception occured while trying to create an instance of UserLoginB. The
exception was "The type serialized in the .resources file was not the same
type that the .resources file said it contained. Expected "UserGroup" but
read ""UserGroup".".

Does anybody have any Idea why this happens?

Thanks,
Nadav.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Terrance | last post by:
Hello all I have a question I'm hoping someone can shed some light on. I have 2 user Inherited Controls on a form. When I click 1 inherited control I would like to change the text of the other...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
8
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and...
0
by: Paul W | last post by:
Hello everyone, My problem is with an inherited Form. The base Form has a few controls on it that are anchored such that they move as the Form is resized. While in the designer, the inherited...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.