Inheritance w/ the Webform Editor

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

when we inherit an ASP.NET webform for from a base class, and have some of
the web controls defined there (the part which is usually contained within
the 'web form designer generated code' region), how can we tell VB not to
insert them in the aspx.vb file again, producing an obvious compiler warning
('should be declared "shadows"') and a runtime binding error everytime I open
the project and first start the debugger?

many thanks & regards
Daniel.
 
Daniel,

I think that is good behaviour, however maybe can you try to set them in
your control standard to invisible.

Cor
 
Cor,

thanks for the hint, i've tried that right now. the behavior does not
change, still - everytime we do a full build after the solution is first
opened, the "protected withevents... line" is added by the environment, and
underlined by syntax checking in one go :-)

an interesting detail might be that in subsequent debugging sessions, while
the solution is still open in the same instance of the IDE, the line is not
added.

the base class of the web forms i am talking about is a pure vb class,
multiply inherited from System.Web.UI.Page without a designer in the
background, thusly:
(it's a BIG project.)

Public Class ViewStatelessTemplate
Inherits System.Web.UI.Page

Public Class clsStandardPageBase
Inherits webcore.ViewStatelessTemplate

Public Class clsCfgDistreesBase
Inherits clsStandardPageBase

Public Class distree_fulfil_stat
Inherits clsCfgDistreesBase

the control is declared in clsCfgDistreesBase, like so:
Protected WithEvents cmdPrint As System.Web.UI.WebControls.Button

the unwanted duplicate is auto-generated in the final, distree_fulfil_stat,
like so:
Protected WithEvents cmdPrint As System.Web.UI.WebControls.Button


maybe that's something we'd rather avoid, a scenario not appreciated by
asp.net?

regards
daniel.
 

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

Back
Top