Example of Defaulting a "Text" Property to the ID?

J

John Saunders

Does anyone have, or can anyone point me to, an example showing how to
default a property of a control to the ID field? If I do this:

public string Text
{
get {return _text == null ? this.ID : _text;}
set {_text = value; ChildControlsCreated = false;}
}

When the control is first dragged onto the page, the Text property has the
correct value in the property browser, but is incorrect in the designer.
It's even correct in the .aspx file.

I know I've seen the answers to this somewhere before, but can't figure it
out right now!

John Saunders
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top