Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Visual Inheritance: Designer inserting imcompatible code

Reply
Thread Tools

Re: Visual Inheritance: Designer inserting imcompatible code

 
 
John Saunders
Guest
Posts: n/a
 
      06-25-2004
"Tom Donohue" <Tom > wrote in message
newsF4BA042-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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIERvbm9odWU=?=
Guest
Posts: n/a
 
      06-25-2004
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
> newsF4BA042-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
>
>
>

 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      06-27-2004
"Tom Donohue" <> wrote in message
news:C348D280-3EA0-42E9-99B4-...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio isn't generating the Code Gen file (*.designer.vb) Nathan Sokalski ASP .Net 7 05-15-2007 03:16 AM
Visual Studio 2005 Global.asax visual designer missing Ben Fidge ASP .Net 0 02-26-2006 01:00 PM
[Visual Studio 2003] - Designer Changing Server-Side Code Mythran ASP .Net 0 12-09-2005 05:08 PM
ASP.Net / C# / Visual Studio.Net Accessing Code Behind Methods and Properties from the Designer Luminousc ASP .Net 4 03-03-2005 02:26 PM
imcompatible memory mix mark mandel Computer Information 3 06-13-2004 05:01 PM



Advertisments