Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > this == base ??

Reply
Thread Tools

this == base ??

 
 
Peter Young
Guest
Posts: n/a
 
      08-11-2004
I'm trying to access the Attributes of a base control, but am seeing something strange.

In this simple example:

namespace WebControlLibrary1
{
public class WebCustomControl1 : System.Web.UI.WebControls.ImageButton
{
protected override void Render(HtmlTextWriter output)
{
System.Diagnostics.Debug.WriteLine(base.GetType(). ToString());
System.Diagnostics.Debug.WriteLine(this.GetType(). ToString());
base.Render(output);
}
}
}

The output of the debug writes is as follows:

WebControlLibrary1.WebCustomControl1
WebControlLibrary1.WebCustomControl1

I expected to see something like this:

System.Web.UI.WebControls.ImageButton
WebControlLibrary1.WebCustomControl1

How do I access the base ImageButton control?

TIA,
Pete


 
Reply With Quote
 
 
 
 
Scott G.
Guest
Posts: n/a
 
      08-12-2004
You should use the Type object of the object you are interested in to see the base class; try

this.GetType().BaseType.FullName

Scott
"Peter Young" <(E-Mail Removed)> wrote in message news:ePLwDK%(E-Mail Removed)...
I'm trying to access the Attributes of a base control, but am seeing something strange.

In this simple example:

namespace WebControlLibrary1
{
public class WebCustomControl1 : System.Web.UI.WebControls.ImageButton
{
protected override void Render(HtmlTextWriter output)
{
System.Diagnostics.Debug.WriteLine(base.GetType(). ToString());
System.Diagnostics.Debug.WriteLine(this.GetType(). ToString());
base.Render(output);
}
}
}

The output of the debug writes is as follows:

WebControlLibrary1.WebCustomControl1
WebControlLibrary1.WebCustomControl1

I expected to see something like this:

System.Web.UI.WebControls.ImageButton
WebControlLibrary1.WebCustomControl1

How do I access the base ImageButton control?

TIA,
Pete


 
Reply With Quote
 
 
 
 
Peter Young
Guest
Posts: n/a
 
      08-12-2004
"Scott G." <(E-Mail Removed)> wrote in message news:Oui%(E-Mail Removed)...
> You should use the Type object of the object you are interested in to see the base class; try
>
> this.GetType().BaseType.FullName


Thx.


 
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
sizeof(EmptyStruct) in C and C++ (was: Base {}; sizeof(Base) == 1?) Alex Vinokur C Programming 7 08-14-2006 04:57 PM
Access of base class' private base class: qualification required, why Alf P. Steinbach C++ 6 09-03-2005 04:03 PM
Format of compiler generated derived destructor when base has 'virtual ~base() throw():" qazmlp C++ 1 04-10-2005 03:09 PM
Virtual function 'BasicMidReader::~BasicMidReader()' conflicts with base class 'base 'TMemoryStream' tomek C++ 2 12-01-2003 06:31 AM
Virtual function 'BasicMidReader::~BasicMidReader()' conflicts with base class 'base 'TMemoryStream' tomek C++ 3 11-30-2003 12:18 AM



Advertisments