472,328 Members | 973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Inheriting local variables from a common source?

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?
Nov 17 '05 #1
2 1229
Hi All

I think a good case study will be a big help in learning OOAD. Does anyone
have a COMPLETE Case Study? I have been searching it for years and got
nothing till today.

A complete case study should have:
1. A clear Problem Description or Requirement.
2. Object-Oriented Analysis in UML diagrams.

Regards
Amit Chaudhary
Nov 17 '05 #2
"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
Nov 17 '05 #3

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

Similar topics

1
by: richardlane | last post by:
Hi, basic question here - I'm struggling with the transfer from asp to asp.net a bit, especially in seeing the 'bigger picture' of how things are...
5
by: masood.iqbal | last post by:
My simplistic mind tells me that having local variables within looping constructs is a bad idea. The reason is that these variables are created...
1
by: richardlane | last post by:
Hi, basic question here - I'm struggling with the transfer from asp to asp.net a bit, especially in seeing the 'bigger picture' of how things are...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.