Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inheriting from a webform with controls.
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00851962
Message ID:
00852195
Views:
9
This just doesn't work. ASP.Net doesn't support visual inheritance... you can create controls dynamically in the base but you can't inherit visual controls... worse you can't even override controls that you place on the child form if they have the same name as the base class and have code from the base access them...

The root of this issue is that ASP.Net treats the visual representation very differently from the 'code' implementation of the form. The controls you place on the form visually must match the controls that exist in code, but they are not really tied to gether. ASP.Net's parser attaches the logic at parse time to link the controls... this model improves a little in ASP.Net 2.0 but still no real visual inheritance.

This is one of the few major flaws in ASP.Net, but then again most people don't do this anyway...

+++ Rick ---

>Am I missing something in the documentation or what? I want to have a base web form with a couple of standard controls. I can drop the controls on the base form and set another form to inherit from the base form.
>
>public class frmMain : frmBaseDEForm
>
>
>With no code behind the controls on the frmBaseDEForm, frmMain is displayed but none of the controls are visible. I attempt to set the controls' visible property to true in the load of frmMain and I get error about null reference. It is like the error I get when there is code behind the controls on frmBaseDEForm.
>
>Ideas of waht I am doing wrong?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform