R
Ryan Ternier
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
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