473,325 Members | 2,828 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,325 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 791

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

Similar topics

4
by: james | last post by:
I have a custom UserControl, which can have many sub class levels derived from it. I want to be able to discover all the components at Load time, but the only components I can see from the base...
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...
8
by: darrel | last post by:
This is a follow-up to a question I asked yesterday. I'm loading a UC programatically as such: =================================================== public customContentControl as UserControl...
2
by: clintonG | last post by:
I've created a base class that inherits from System.Web.UI.Page. I've been using Page_PreInit in the base class to change Themes. I'm using MasterPages and need a bunch of code in each content...
0
by: Edward Diener | last post by:
I have a base class derived from System.Web.UI.Page, and derived classes derived from the base class. The base class has protected HTML hidden fields in it, and the derived class's aspx page has...
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!...
0
by: droyad | last post by:
I have recently upgraded a web project from ASP.NET 1.1 to ASP.NET 2.0, and now the event handlers no longer work, due to the event handlers being defined in base classes. To start a bit of...
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: Steve Richter | last post by:
my composite control does not render correctly the 2nd time it is made visible. When I change the base class from CompositeControl to WebControl, the control works as it should. public class...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.