By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,563 Members | 1,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,563 IT Pros & Developers. It's quick & easy.

page inheritance bug fixed

P: n/a
JR
I'm developing in VS.NET 2002 and I'm having trouble working around the
issue with page inheritance and the VS.NET Form Designer.

When I create a base class for my form, and inherit from it, I can no longer
bring up the inherited form in the designer. I get the error "The file
failed to load in the Web form designer. please correct the following error,
then load it again : Type Abstract"

Apparently, others have experienced this problem and one workaround is not
declaring the base class as MustInherit.

However, I have a problem with that. My base class handles some processing
in Page_Load. In order to handle some instance-specific handling in the
derived class, I added an Initialize method in the base class and flagged it
as Overridable originally.

If I'm forced to remove the MustInherit and Overridable attributes in my
base class to work around the VS designer issue, then when my code executes,
the Initialize method executes IN THE BASE CLASS, as opposed to in the
derived class. That's not what I want (which is .

I can probably fix this by refactoring the way I'm handing the
initialization, but I'd still like to know if the VS.NET designer issue has
been corrected.

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi JR:

Perhaps you could post some code as an example of what is not working
for you. You should be able to remove the MustInherit keyword and
leave the method as Overridable and have the behavior you need.

As a side note, I've tried this in VS.NET 2005 (the May preview) and
it appears to work.

http://odetocode.com/Blogs/scott/arc...06/24/286.aspx

--
Scott
On Fri, 25 Jun 2004 10:48:17 -0500, "JR" <jr@newsgroups.nospam> wrote:
I'm developing in VS.NET 2002 and I'm having trouble working around the
issue with page inheritance and the VS.NET Form Designer.

When I create a base class for my form, and inherit from it, I can no longer
bring up the inherited form in the designer. I get the error "The file
failed to load in the Web form designer. please correct the following error,
then load it again : Type Abstract"

Apparently, others have experienced this problem and one workaround is not
declaring the base class as MustInherit.

However, I have a problem with that. My base class handles some processing
in Page_Load. In order to handle some instance-specific handling in the
derived class, I added an Initialize method in the base class and flagged it
as Overridable originally.

If I'm forced to remove the MustInherit and Overridable attributes in my
base class to work around the VS designer issue, then when my code executes,
the Initialize method executes IN THE BASE CLASS, as opposed to in the
derived class. That's not what I want (which is .

I can probably fix this by refactoring the way I'm handing the
initialization, but I'd still like to know if the VS.NET designer issue has
been corrected.


Nov 18 '05 #2

P: n/a
Hi JR,

The problem that we get error when open a form(no matter web form or
winform) in designer which is dervied from an abstract base class is a
known behavior. In fact, this is because when we open a form in the
VS.NET's design view, the IDE will try creating an instance of the Form's
base class( notice that it is the base class rather than the derived actual
class). The reason why the IDE not create the instance of the derived class
is that the Dervied class is the one under edit and its properties or
interfaces may haven't been completed so the IDE is only able to instantial
its base class and apply the derived class's properties and features onto
the base class instance. Here are some former threads in the group
discussing this problem:

http://groups.google.com/groups?hl=e...37nTi9PEHA.308
%40cpmsftngxa10.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%2
6q%3D%2Babstract%2Bclass%2Bsteven%2Bcheng

http://groups.google.com/groups?hl=e...d101c229b0%240
3216ba0%2436ef2ecf%40tkmsftngxa12&rnum=10&prev=/groups%3Fhl%3Den%26lr%3D%26i
e%3DUTF-8%26q%3Dform%2Bdesigner%2Babstract%2Bclass

Hope also helpful on understanding this. Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.