Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do i: Visual Inheritance

Reply
Thread Tools

How do i: Visual Inheritance

 
 
John Blair
Guest
Posts: n/a
 
      01-12-2005
Hi,

I have one form that i want to make similar to another form but add some
additional controls. I thought the following code would make my webform4
have all the content of webform3 but nothing shows up in webform4.....how do
i make this work?

Thanks.
Public Class WebForm4

Inherits WebForm3


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-12-2005
In asp.net 2.0 you have Master pages. There are some 3rd party
implementaions for 1.1. Google for something like "Master Pages for ASP.NET
1.1"

Eliyahu

"John Blair" <(E-Mail Removed)> wrote in message
news:_i9Fd.1224$q%(E-Mail Removed)...
> Hi,
>
> I have one form that i want to make similar to another form but add some
> additional controls. I thought the following code would make my webform4
> have all the content of webform3 but nothing shows up in webform4.....how

do
> i make this work?
>
> Thanks.
> Public Class WebForm4
>
> Inherits WebForm3
>
>



 
Reply With Quote
 
 
 
 
John Blair
Guest
Posts: n/a
 
      01-12-2005
Thanks again....i thought from the vb.net documentation i could do it in
1.1!
"Eliyahu Goldin" <(E-Mail Removed)> wrote in message
news:uhfXk1K%(E-Mail Removed)...
> In asp.net 2.0 you have Master pages. There are some 3rd party
> implementaions for 1.1. Google for something like "Master Pages for
> ASP.NET
> 1.1"
>
> Eliyahu
>
> "John Blair" <(E-Mail Removed)> wrote in message
> news:_i9Fd.1224$q%(E-Mail Removed)...
>> Hi,
>>
>> I have one form that i want to make similar to another form but add some
>> additional controls. I thought the following code would make my webform4
>> have all the content of webform3 but nothing shows up in webform4.....how

> do
>> i make this work?
>>
>> Thanks.
>> Public Class WebForm4
>>
>> Inherits WebForm3
>>
>>

>
>



 
Reply With Quote
 
Philip Q [MVP]
Guest
Posts: n/a
 
      01-12-2005
This is not possible, because, although all of your controls are instance
variables in the WebForm3 class, there is no rendering code in WebForm3.
If you embed the rendering code inside of WebForm3 (probably inside of
InitialiseComponent), by adding the controls to Page, the controls and their
rendering will also be inherited.

--
Philip Q
Microsoft MVP [ASP.NET]

"John Blair" <(E-Mail Removed)> wrote in message
news:_i9Fd.1224$q%(E-Mail Removed)...
> Hi,
>
> I have one form that i want to make similar to another form but add some
> additional controls. I thought the following code would make my webform4
> have all the content of webform3 but nothing shows up in webform4.....how
> do i make this work?
>
> Thanks.
> Public Class WebForm4
>
> Inherits WebForm3
>
>



 
Reply With Quote
 
John Blair
Guest
Posts: n/a
 
      01-12-2005
Thanks a lot for the feedback....i dont understand the rendering process - i
thought webform3 contained its own redering by default as the controls
display for webform3 when it is say the default start page....but i take
your word this is not possible! Thanks.

"Philip Q [MVP]" <(E-Mail Removed)> wrote in message
news:%23ZyaYHL%(E-Mail Removed)...
> This is not possible, because, although all of your controls are instance
> variables in the WebForm3 class, there is no rendering code in WebForm3.
> If you embed the rendering code inside of WebForm3 (probably inside of
> InitialiseComponent), by adding the controls to Page, the controls and
> their rendering will also be inherited.
>
> --
> Philip Q
> Microsoft MVP [ASP.NET]
>
> "John Blair" <(E-Mail Removed)> wrote in message
> news:_i9Fd.1224$q%(E-Mail Removed)...
>> Hi,
>>
>> I have one form that i want to make similar to another form but add some
>> additional controls. I thought the following code would make my webform4
>> have all the content of webform3 but nothing shows up in webform4.....how
>> do i make this work?
>>
>> Thanks.
>> Public Class WebForm4
>>
>> Inherits WebForm3
>>
>>

>
>



 
Reply With Quote
 
John Blair
Guest
Posts: n/a
 
      01-12-2005
Hi,

Thought about what you wrote and tried my example with windows forms - it
works for that!
I now see that with web forms my webform3 is the code behind class only and
not the "HTML" part which i presume does the
rendering so hence no display of controls when i just inherit the code
behind class!
Was nice to see this work with windows forms though! Thanks again!

"John Blair" <(E-Mail Removed)> wrote in message
news:JwcFd.1534$q%(E-Mail Removed)...
> Thanks a lot for the feedback....i dont understand the rendering process -
> i thought webform3 contained its own redering by default as the controls
> display for webform3 when it is say the default start page....but i take
> your word this is not possible! Thanks.
>
> "Philip Q [MVP]" <(E-Mail Removed)> wrote in message
> news:%23ZyaYHL%(E-Mail Removed)...
>> This is not possible, because, although all of your controls are instance
>> variables in the WebForm3 class, there is no rendering code in WebForm3.
>> If you embed the rendering code inside of WebForm3 (probably inside of
>> InitialiseComponent), by adding the controls to Page, the controls and
>> their rendering will also be inherited.
>>
>> --
>> Philip Q
>> Microsoft MVP [ASP.NET]
>>
>> "John Blair" <(E-Mail Removed)> wrote in message
>> news:_i9Fd.1224$q%(E-Mail Removed)...
>>> Hi,
>>>
>>> I have one form that i want to make similar to another form but add some
>>> additional controls. I thought the following code would make my webform4
>>> have all the content of webform3 but nothing shows up in
>>> webform4.....how do i make this work?
>>>
>>> Thanks.
>>> Public Class WebForm4
>>>
>>> Inherits WebForm3
>>>
>>>

>>
>>

>
>



 
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
C++ Struct inheritance against class inheritance johnsonlau C++ 1 07-21-2008 04:58 PM
Interface inheritance vs Implementation inheritance. Daniel Pitts Java 27 02-27-2008 01:37 AM
Private Inheritance and Publice Inheritance karthikbalaguru C++ 9 09-10-2007 01:05 PM
mul. inheritance & overloading operator new/delete solved by virtual base inheritance? cppsks C++ 0 10-27-2004 07:49 PM
Private access modifier and Inheritance (Inheritance implementation in Java) maxw_cc Java 1 12-21-2003 11:38 AM



Advertisments