I am testing using a custom control for page content in hopes I can use this for a templating system. I have a user control called "content", and I can pass it a parameter for an html page(filename) to output...
currently I have the content control using File.Open to read the HTML files and then using writeline to write the fileread to HTML.. like so...
'This is in my Custom Control "Content"
vb...
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim path As String
path = App_Path() & pgload 'pgloadholds the html filename as a string
' Open the stream and read it back.
Dim sr As StreamReader = File.OpenText(path)
Dim input As String
input = sr.ReadLine()
While Not input Is Nothing
writer.WriteLine(input)
input = sr.ReadLine()
End While
sr.Close()
End Sub
What I am wondering is if there is a better/faster/different way of doing this same thing...
?
-------------------------
Beware of programmers with screwdrivers...