Inherited Web Label doesnt properly initialize "Text" property

A

Aaron Abdis

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
 
A

Aaron Abdis

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top