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:
00852299
Views:
7
Thank you. It wasn't the answer I was hoping for. Having 20+ Add Edit Update forms that are extremely similar just screem for this functionality. I'll have to look at creating some custom control classes. Before I waste time on this, I don't suppose I can drop some controls in a panel and inherit from that custom panel?



>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?
Fred Lauckner

You know, it works on my computer. I don't know what your problem is.

.Net aint so bad.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform