Re: Visual Inheritance: Designer inserting imcompatible code

Discussion in 'ASP .Net' started by John Saunders, Jun 25, 2004.

  1. "Tom Donohue" <Tom > wrote in message
    news:D...
    > 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
     
    John Saunders, Jun 25, 2004
    #1
    1. Advertising

  2. Thanks for the reply. I'll continue with my current work around.

    If Microsoft is monitoring this, they might wish to consider this capability in the next release. Taking one of the three legs out of the Object Oriented Programming stool (Inheritance, Polymorphism, and Encapsulation) is a severe drawback to the .Net strategy. This is compounded by Microsoft's traditional lack of support for Template Pages (ie. Compare FP2003 with Dreamweaver MX).


    "John Saunders" wrote:

    > "Tom Donohue" <Tom > wrote in message
    > news:D...
    > > 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
    >
    >
    >
     
    =?Utf-8?B?VG9tIERvbm9odWU=?=, Jun 25, 2004
    #2
    1. Advertising

  3. "Tom Donohue" <> wrote in message
    news:...
    > Thanks for the reply. I'll continue with my current work around.
    >
    > If Microsoft is monitoring this, they might wish to consider this

    capability in the next release. Taking one of the three legs out of the
    Object Oriented Programming stool (Inheritance, Polymorphism, and
    Encapsulation) is a severe drawback to the .Net strategy. This is compounded
    by Microsoft's traditional lack of support for Template Pages (ie. Compare
    FP2003 with Dreamweaver MX).

    The lack of templating is fixed in ASP.NET 2.0. I don't know if they've also
    fixed the designers to support "visual inheritance".
    --
    John Saunders
    johnwsaundersiii at hotmail
     
    John Saunders, Jun 27, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luminousc
    Replies:
    4
    Views:
    567
  2. Ben Fidge
    Replies:
    0
    Views:
    1,833
    Ben Fidge
    Feb 26, 2006
  3. Steve B.
    Replies:
    4
    Views:
    999
    Cheryl D Wise
    Jun 1, 2007
  4. Alexander Higgins
    Replies:
    3
    Views:
    1,109
    Teemu Keiski
    Jul 30, 2007
  5. Alexander Higgins
    Replies:
    0
    Views:
    470
    Alexander Higgins
    Jul 21, 2007
Loading...

Share This Page