Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Inherited Web Label doesnt properly initialize "Text" property

Reply
Thread Tools

Inherited Web Label doesnt properly initialize "Text" property

 
 
Aaron Abdis
Guest
Posts: n/a
 
      08-09-2004
Hello!

I have a control i wrote which inherits from the built in Label control in
ASP.NET. I wrote this control to add the "for" attribute of a 'real' web
label. It worked fine and normal. I just recently reworked it so that the
FOR property has a drop down in the property grid which lists all the static
controls on the page by clientid (you can still type in your own text).

Once i added the appropriate designers and such to support the controls
drop-down list property style, the control no longer initializes the Text
property when you put it on a form. Normally when you drop a plain label on
a form, it's text says "Label1" (or whatever # your up to). Now when i drop
my label on a form though, it just comes up with blank text. So i tried
putting "Me.Text = Me.ClientID" into the Init events, handlers or overrides
for my label, but then of course whenever the page is opened, it just says
"Label1".

Why would adding a designer kill the inheritance of the Text property??

Thanks in advance,

- Aaron


 
Reply With Quote
 
 
 
 
MattC
Guest
Posts: n/a
 
      08-17-2004
Did you still call base.OnInit in your overridden OnInit?


"Aaron Abdis" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello!
>
> I have a control i wrote which inherits from the built in Label control in
> ASP.NET. I wrote this control to add the "for" attribute of a 'real' web
> label. It worked fine and normal. I just recently reworked it so that the
> FOR property has a drop down in the property grid which lists all the

static
> controls on the page by clientid (you can still type in your own text).
>
> Once i added the appropriate designers and such to support the controls
> drop-down list property style, the control no longer initializes the Text
> property when you put it on a form. Normally when you drop a plain label

on
> a form, it's text says "Label1" (or whatever # your up to). Now when i

drop
> my label on a form though, it just comes up with blank text. So i tried
> putting "Me.Text = Me.ClientID" into the Init events, handlers or

overrides
> for my label, but then of course whenever the page is opened, it just says
> "Label1".
>
> Why would adding a designer kill the inheritance of the Text property??
>
> Thanks in advance,
>
> - Aaron
>
>



 
Reply With Quote
 
 
 
 
Aaron Abdis
Guest
Posts: n/a
 
      08-19-2004

Actually no, i had forgotten that. However, if that were my problem, then it
shouldve worked fine before i had added the OnInit override. Just to make
sure though, i put back in my override, and called base.OnInit, but it still
did not work.



"MattC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Did you still call base.OnInit in your overridden OnInit?
>
>
> "Aaron Abdis" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello!
> >
> > I have a control i wrote which inherits from the built in Label control

in
> > ASP.NET. I wrote this control to add the "for" attribute of a 'real' web
> > label. It worked fine and normal. I just recently reworked it so that

the
> > FOR property has a drop down in the property grid which lists all the

> static
> > controls on the page by clientid (you can still type in your own text).
> >
> > Once i added the appropriate designers and such to support the controls
> > drop-down list property style, the control no longer initializes the

Text
> > property when you put it on a form. Normally when you drop a plain label

> on
> > a form, it's text says "Label1" (or whatever # your up to). Now when i

> drop
> > my label on a form though, it just comes up with blank text. So i tried
> > putting "Me.Text = Me.ClientID" into the Init events, handlers or

> overrides
> > for my label, but then of course whenever the page is opened, it just

says
> > "Label1".
> >
> > Why would adding a designer kill the inheritance of the Text property??
> >
> > Thanks in advance,
> >
> > - Aaron
> >
> >

>
>



 
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
sort list doesnt work, key=str still doesnt work notnorwegian@yahoo.se Python 3 05-27-2008 04:32 AM
'Class.inherited' v. 'inherited' syntax inside Class 7stud -- Ruby 11 11-09-2007 06:45 PM
PC doesnt boot first time and doesnt shutdown dann Computer Support 6 08-21-2006 07:31 AM
if instance variable get initialize after assigning some values or after constructor then when does static variable get initialize Tony Morris Java 3 02-04-2006 08:39 AM
Inherited Web Label doesnt properly initialize "Text" property Aaron Abdis ASP .Net Building Controls 2 08-19-2004 02:08 AM



Advertisments