Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2005, 02:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ~Bean~
Default Template Control Content

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...
__________________
-------------------------
Beware of programmers with screwdrivers...





Similar Threads
Thread Thread Starter Forum Replies Last Post
content template manisha agarwal ASP.NET 2.0 Basics 1 September 2nd, 2008 10:09 AM
Adding content control to table's row rezarezash Word VBA 0 August 23rd, 2008 12:36 AM
Control IDs in content pages LMIILM BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 1 December 8th, 2007 06:30 AM
Trying to find control on content page webjedi ASP.NET 2.0 Professional 1 April 28th, 2006 06:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.