New to Controls - help with Checkbox RenderContents(...)
- From: Ryan Ternier <rternier@xxxxxxxxxxxxxxxx>
- Date: Tue, 07 Jun 2005 13:41:33 -0700
I'm new to creating controls, so I wanted to start with something simple.
A simple checkbox, but with a small footer tag underneath the acual text to put anything you want.
I'm not worried about the formatting yet, that's easy to do. My question lies with the RenderContents() method. In my user control, it's not even fireing mine, it's displaying a regular check box.
here's the code:
private string footNoteCss;
private string footNote;
public string FootNoteCss
{
get
{
return (footNoteCss != null ? footNoteCss:String.Empty);
}
set
{
footNoteCss = value;
}
} public string FootNote
{
get
{
return (footNote != null ? footNote : String.Empty);
}
set
{
footNote = value;
}
}
//Overrides the REnderContents method
protected override void RenderContents(System.Web.UI.HtmlTextWriter writer)
{
writer.Write(ActivateFootNote(base.Text));
}private string ActivateFootNote(string theText)
{
string buf = theText + "<div class='" + footNoteCss + "'>" + footNote + "</div>";
return buf;
}
}
-----
I've overriden the Render event, and it calls mine fine, but I don't want to override Render... i want to override the content.
Any suggestions?
/RT .
- Prev by Date: Re: retrieve value of dynamic web control
- Next by Date: Experts, am I right about this? [TabControl insanity]
- Previous by thread: custom web control
- Next by thread: Experts, am I right about this? [TabControl insanity]
- Index(es):