473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Base class and controls

Hello,

I made a base class for all the pages in my project, so that instead
of "public class CSomePage : System.Web.UI.Page" i got "public class
CSomePage : CPage

Since some parameters are common to all pages, i did put some server
hidden fields controls in the base class.

Ex: (in the base class)

protected Gam.CHiddenField mIdEntreprise;
protected Gam.CHiddenField mIdCoord;

Like that, i put some <asp:CHiddenField ... /> in each aspx and i can
reference my controls (mIdEntreprise and mIdCoord) in the derived
classes. Works great.

However when i modify the html code in an aspx the vs editor is adding
the following code in the derived class :

protected Gam.CHiddenField mIdEntreprise;
protected Gam.CHiddenField mIdCoord;

Thus overriding the declarations in the base class, resulting in
errors at runtime. I have to remove the declarations in the derived
class manually everytime, very annoying. How can i stop the vs editor
to add the declarations in the derived class, if the control is
already declared in the base class?

Thanks for any help. Matt

Nov 18 '05 #1
0 646

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

Similar topics

0
by: Rans | last post by:
Hello, I made a base class for all the pages in my project, so that instead of "public class CSomePage : System.Web.UI.Page" i got "public class CSomePage : CPage Since some parameters are...
0
by: Rans | last post by:
Hello, I made a base class for all the pages in my project, so that instead of "public class CSomePage : System.Web.UI.Page" i got "public class CSomePage : CPage Since some parameters are...
1
by: matt | last post by:
Hi, I have two very similar pages, whose codebehind I'd like to derive from the same base class so I can reuse the controller logic. For (hopeful) clarity I'll try and draw this in ASCII-UML!...
26
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is...
0
by: rjl444 | last post by:
web developer express asp.net 2.0: I need to have 3 user controls. these controls include a textbox and several asp controls (checkbox, button, etc). I would like to have a base class that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.