Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing HTML Outputted By A User Control

Status
Not open for further replies.

jessedh

MIS
Apr 16, 2002
96
US
Hello,

I have to create an archive of the HTML that a user control displays by storing the static HTML in a SQL database. I do not have a clue how to do this in .Net. I can't seem to see a .Render option for the user control which was logically starting place.

If this doesn't seem logical, I am open to any suggestions...

Please help me!!!

thanks!
 
How about the RenderControl method?

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
It doesn't seem to work on a user control. There is the distinct possibility that my code is off.

Check it out below, this is called from a main page, the control is called preappdisplay.ascx...

Code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here

        'For Population


        Dim SB As New System.Text.StringBuilder
        Dim SW As New System.IO.StringWriter(SB)
        Dim htmlTW As New HtmlTextWriter(SW)
        Dim s As String


        Me.Controls.Item(0).RenderControl(htmlTW)
        htmlTW.Write(s)
        System.Diagnostics.Debug.WriteLine(s)

        s = s & "123"
        lblTest.Text = s

THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top