"Wayne J" <no**@anyisp.com> wrote in message
news:#Y**************@tk2msftngp13.phx.gbl...
I have 3 pages, each with 2 tables (tblNew and tblConfirm), because these
2 tables are affected by the same code, I thought if I used an inherited
class defining these variables along with the code, it would work.
It does, to a point, but everytime I hit "Save" I will see errors pile up
thanks to conflicting variable names.
On the code-behind for the pages, VS will fill in the variable names even
though I have already declared them in the inheritted class.
Doesn't VS traverse the inherited list or are these ignored and only used
at compilation?
VS doesn't traverse anything. Its model is much simpler: if you put the
control on the .aspx page, then a protected reference to that control will
be placed on the .aspx.cs page. Period.
Depending on the complexity of your code, you might want to define a class
which encapsulates all the common processing done on the tables, and which
perhaps contains a public property which you can set to be a reference to
the table. Then that class will have all the local variables.
Besides, even if the inheritance worked, you wouldn't really want to have
common base pages for something like this. Since there's only single
inheritance, you want to inherit from something important - you don't want
to have a base class called "PagesWithThisSortOfTableOnThem"!
--
John