"Tom Donohue" <Tom
> wrote in message
news

F4BA042-8505-4FDD-80F2-...
> I have found this problem in the Winforms of .Net as well, but for
simplicity I'll restrict my question to the asp.net.
>
> 1. Create a webform and put a placeholder on the page. Call it
wfTemplate.aspx
> 2. OnLoad call an Overridable Sub SetPlaceholder
> 3. the set placeholder sub declares a user control (ie. ucTemplate.ascx)
and replaces the Placeholder. All works fine.
> 4. Now build a second webform. Replace the "inherits system.web.ui.page"
dirctive with "Inherits wfTemplate".
> 5. Override the SetPlaceholder sub with a sub that declares a user control
(ie. ucChild.ascx) and replaces the Placeholder.
>
> Here is where the problem is...
> The designer insistes on declaring the placeholder in the child form (ie
Protected withevernts pl as system.web.ui.placeholder) in the child form.
Since this form is inheriting from the template, the code will fail (it
can't be declared as Shadows because the parent form may need to access the
control).
>
> The only solution I have found is to manually delete the declaration in
the child form. This becomes quite a chore as the page count increases.
Futhermore, this deletion must take place every time the child webform is
opened as the designer keeps inserting the declaration code.
>
> What am I missing? There has to be a better way of visually inheritig from
a parent form. As the complexity and number of controls and pages increase,
management becomes significant.
Visual Studio.NET does not support visual inheritance for web forms at all.
--
John Saunders
johnwsaundersiii at hotmail