Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8275045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:56:38+00:00 2026-06-08T07:56:38+00:00

In vb.net or C# web sites How do I access the final html just

  • 0

In vb.net or C# web sites

How do I access the final html just before it leaves the server so that I can make a final html tweaks from the code-behind.( I don’t want to use JavaScript to make these adjustments)

Will it be the page PreRenderComplete event that will be the last event that fires that I will be able to see the html that is sent to the browser which I will be able to edit the html with HtmlAgilityPack?

This must be easy to do and possible

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:56:40+00:00Added an answer on June 8, 2026 at 7:56 am

    Hi I just wanted to share what I came up with after reading the responses to my post and doing some searching online and with reference to this forum post here http://forums.asp.net/t/1146098.aspx/1 and using HtmlAggilityPack http://htmlagilitypack.codeplex.com/wikipage?title=Examples

    Here is the code

    Imports System.IO
    Imports HtmlAgilityPack
    
    Partial Class Default2
        Inherits System.Web.UI.Page
    
        Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
    
            Dim mem As New System.IO.MemoryStream()
            Dim twr As New System.IO.StreamWriter(mem)
            Dim myWriter As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(twr)
            MyBase.Render(myWriter)
    
            myWriter.Flush()
            myWriter.Dispose()
    
            Dim strmRdr As New System.IO.StreamReader(mem)
            strmRdr.BaseStream.Position = 0
            Dim pageContent As String = strmRdr.ReadToEnd()
            strmRdr.Dispose()
            mem.Dispose()
    
            writer.Write(AlterWithHTMLAGP(pageContent))
    
    
        End Sub
    
    
    
        Function AlterWithHTMLAGP(ByVal pageSource As String) As String
    
            Dim htmlDoc As HtmlDocument = New HtmlDocument()
    
            htmlDoc.OptionFixNestedTags = True
    
            htmlDoc.LoadHtml(pageSource)
    
            Dim newNode As HtmlNode = HtmlNode.CreateNode("<div>" & "someHtml" & "</div>")
    
            Dim body As HtmlNode = htmlDoc.DocumentNode.SelectSingleNode("//body")
    
            body.PrependChild(newNode)
    
    
            Return htmlDoc.DocumentNode.WriteTo()
    
        End Function
    
    
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site built using ASP.NET MVC4 that I can publish fine
We need to increase our knowledge on deployment of ASP.NET Web sites/Web App. We
I have a asp.net web site that was developed on the .Net Framework v2
In an ASP.NET Web Site project, I've always been able to make changes to
I have created an App that gets data from Web Services on an In
I have to design a Data Access Layer with .NET that probably will use
I have an ASP.NET web server and I wish to have a watchdog sending
I have an IIS7.5 web-site, on Windows Server 2008, with an ASP.NET MVC2 web-site
I have an large ASP.Net web application that will have a large number of
I need to integrate two ASP.NET sites user-wise. I have a Web Pages ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.