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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:57:22+00:00 2026-05-22T02:57:22+00:00

I have a complex html table that I would like to export as CSV.

  • 0

I have a complex html table that I would like to export as CSV. To start with, I am trying to figure out if this can be done on server side. Table is created using the StringBuilder and spitted out in a div.

Rule is that CSV has to be the created from the HTML markup in the browser not from model or data.

To be able to create CSV on server side, I am unable to determine how to get/access the exact markup from the browser in one action methods after clicking the save button.

For now there is not much to the code itself as I am trying to just access the table in the controller. but here is what it looks like:
This is the request onclick for a button.

 $.ajax({
            async: false,
            url: "Application/Export",
            dataType: "html",
            type: "POST",
            success: function (data) {
                alert(data);
            },
            error: function () { alert("Error!"); }
        });

Controller is empty for now:

   public string Export(string id)
    {
        //Convert to csv here
        return id;
    }

Any ideas?

  • 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-05-22T02:57:23+00:00Added an answer on May 22, 2026 at 2:57 am

    Why on earth would you be required to use the HTML table and not data from the model? Please explain the reasoning behind this.

    Edit: If you’re screen scraping, then you’ll need to grab the page via HTTP request, parse the HTML, then iterate over the parsed nodes while populating a CSV.

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

Sidebar

Related Questions

I have a complex html DOM tree of the following nature: <table> ... <tr>
I have a complex command that I'd like to make a shell/bash script of.
Well i have a complex form view model like this : public class TransactionFormViewModel
Do you have any suggestion for this particular problem. I have fairly complex html
I have been trying to use Jeditable to make my html table editable. However
I have a huge html table that I am building dynamically, and I want
I have a complex Regex which is used to help strip out HTML from
I have a collection of documents that I'm attempting to parse. Like HTML, they
I have a fairly complex html form enhanced via jquery. It has multiple tabs,
I have a complex .NET Remoting server app that provides a couple of services.

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.