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 8430777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:40:45+00:00 2026-06-10T05:40:45+00:00

I have a web site that displays a table along with some buttons, navigation

  • 0

I have a web site that displays a table along with some buttons, navigation tabs, etc. Using HtmlAgilityPack I would like to save only the node containing the table (a div) to a .html file. I have been experimenting with this code:

string dashboard = doc.DocumentNode.SelectSingleNode("//div[@id='Dashboard']").InnerHtml;
doc.LoadHtml(dashboard);
doc.Save(currDir + "\\dashboardOutputFile.html");

But this only preserves the text components of the table and none of its layout/display information. I have tried adding a Doctype declaration as well as enclosing html and body tags to the dashboard string but it has no effect.

Any advice is appreciated.

Regards.

EDIT:

I should be more explicit. I am capturing the html of my page by overriding the Render method:

protected override void Render(HtmlTextWriter writer)
{
    using (HtmlTextWriter htmlwriter = new HtmlTextWriter(new StringWriter()))
    {
        base.Render(htmlwriter);
        string renderedContent = htmlwriter.InnerWriter.ToString();

        var doc = new HtmlDocument();
        doc.LoadHtml(renderedContent);

        try
        {
            string dashboard = doc.DocumentNode.SelectSingleNode("//div[@id='Dashboard']").InnerHtml;
            dashboard = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><br><html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body><div><br>" + dashboard + "<br></div></body></html>";
            doc.LoadHtml(dashboard);
            doc.Save(currDir + "\\dashboardOutputFile.html");
        }
        catch (NullReferenceException ex)
        {
            // Do nothing.
        }
        writer.Write(renderedContent);
    }
}

To the best of my knowledge the string “dashboard” should contain a complete HTML page after this. However the resulting .html file displays like this:

INCIDENT MANAGEMENT
Jun '12 F'12
Trend   F'12    2011
(avg)
Severe Incidents (Sev1/2):  2       2   4.16
Severe Avoidable Incidents (Sev1/2):    1       1.3 1.91
Incidents (Sev3):   600     459 460.92
Incidents (Sev4) - No business Impact:  869     782 793
Proactive Tickets Opened:   24      20  14
Proactive Tickets Resolved/Closed:  22      17.8    11
CHANGE MANAGEMENT
Total Planned Changes:  623     564 583.58
Change Success Rate (%):    99.9        99.4    99
Non-Remedial Urgent Changes:    5       11.4    47.08
PROBLEM MANAGEMENT
New PIRs:   1       1.4 2
Closed PIRs:    1       2.3 3
Overdue Action items:   2       3.4 0
COMPLIANCE MEASUREMENTS
    Jun Trend   May
Total Number of Perimeter Devices:  258     242
Perimeter Devices - Non Compliant:  31      7
Total Number of Internal Devices:   6632        6521
Internal Devices - Non Compliant:   160     38
Unauthorized Perimeter Changes: 0       0
Unauthorized Internal Changes   0       0
LEGEND

ISP LINKS
June    May Trend
SOC CPO DRP SOC CPO DRP
39% 35% 74%     38% 35% 73%     
BELL MPLS HEAD ENDS
June    May Trend
SOC CPO SOC CPO
8%  5.5%    7%  10% 7.5%    5%  6%  10% 
ENTERPRISE NETWORK (# of issues called out)
June    May Trend
CORE    FW/DMZ  CORE    FW/DMZ
1   0   1   0   
US & INTL (# of issues called out)
June    May Trend
US  Intl    US  Intl
2   3   2   3   
LINE OF BUSINESS    BELL WAN MPLS
<>  50%-65% >65%    <>  50%-65% >65%    Trend
Retail: 2269    4   0   2271    2   0   
Business Banking:   60  0   0   51  1   0   
Wealth: 121 2   1   111 3   2   
Corporate:  49  2   0   51  1   1   
Remote ATM: 280 0   0   279 0   0   
TOOLS
Version Currency    Vulnerability Status    Health Status
Key Messages:

Only the text of the table cells is being displayed. There is no table layout, no background colours, etc. Even when I copy the file into JSFiddle it displays like this. What am I missing to make this a complete HTML page?

  • 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-10T05:40:46+00:00Added an answer on June 10, 2026 at 5:40 am

    There’s probably a css file linked into the original html not being read in your downloaded page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a web site that requires user registration and authentication for some
I have a web site that is designed in asp.net and working fine in
I have a web site that spits out links to third party sites. Now
I have a web site that runs both classic ASP and ASP.NET Webforms. The
I have a web site that work with external Credit Card Processing (cybersource) when
I have a web site that contains an HTML form, in this form I
I have a web service site that is restful enabled, so other websites/ajax script
I have a very simple table on my website, that displays different URL's. I
I'm building a web app that displays a list of customers in a table.
I have a website that displays pictures in an html table. When I click

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.