May 29th, 2013, 09:14 PM
Passing derived class members to base class constructer?
I'm trying to derive a class from HtmlTextWriter to specifically write Html to a string.
This means constructing the HtmlTextWriter class with some strings, but as these strings are part of the derived class, I can't pass them to the base class constuctor! Here's my code. Any ideas to get around this?
Of course I can simply have an instance of HtmlTextWriter within the base class, but then I can't just call all the members of HtmlTextWriter directly in my HtmlStringWriter class.
public class HtmlStringWriter : HtmlTextWriter
htmlString = new StringBuilder(); // this will hold the string
stringWriter = new StringWriter(htmlString);
Last edited by surfdabbler; May 29th, 2013 at 09:19 PM.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!