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

Inheritance w/ the Webform Editor

P: n/a
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.
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Daniel,

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

Cor
Nov 21 '05 #2

P: n/a
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.

"Cor Ligthert" schrieb:
Daniel,

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

Cor

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.