Hello
I want to create a custom control that is essentially a hyperlink with various additional attributes.
Just a simplified example:
<cc1:MySpecialHyperlink href="~login.aspx">Click here!</cc1:MySpeicalHyperlink>
I'd like to know how to get hold of the inner text node of the control programatically from within my RenderContents method (in the example above, the 'Click here!' string).
How's this done?
Mark
Hi Mark,
Typically, if you're deriving your custom hyperlink from the standard hyperlink class, then the inner text node is set \ retrieved by the Text property. More generally, you can access it through the DefaultProperty for your control (which is typically 'Text'). Have a look at the code on page 778 for a commentary but this might work.
namespace MyControls
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:MySpecialHyperlink runat=server></{0}:MySpecialHyperlink>")]
public class MySpecialHyperlink : Hyperlink
{
etc ...