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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:19:01+00:00 2026-06-10T01:19:01+00:00

My requirement is the following: From my ASPX page I import data from a

  • 0

My requirement is the following:

From my ASPX page I import data from a spreadsheet using fileUpload and dynamically generate an ASP.NET table. The table rows and columns dimensions and data are set by the file itself – that means my application has no knowledge of rows and columns until the data is imported.

What I would like to do is to apply jQuery DataTables plugin to my dynamically generated table. The table is generated when user clicks the Import button on the page.

The problem I have is that the jscript to format the table runs before the table is available and therefore DataTable plug-in complains about columns. The error reads:

Unable to get value of the property ‘aoColumns’: object is null or undefined

I’ve tried to add the following code to my Button_Click event but it happens before the table is loaded:

ClientScript.RegisterClientScriptBlock(Me.GetType(), “FormatTable”, “FormatTable();”, True)

The jscript is the following:

  function FormatTable() {
                    var oTable = $('#tblMyTable).dataTable({
                        "bJQueryUI": true,
                        "sScrollY": "300px",
                        "sScrollX": "100%",
                        "sScrollXInner": "150%",
                        "bScrollCollapse": true,
                        "bPaginate": false
                    });
                    new FixedColumns(oTable);
    };

I made sure the table is well-formed with table, thead, tr, th, tbody, tr, td. When the table is generated from code behind, it is inserted in a server placeholder control.

So my question is: how can I successfully format a server generated table using jQuery DataTables plug-in ? Thank you very for any help.

  • 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-10T01:19:02+00:00Added an answer on June 10, 2026 at 1:19 am

    In this case you want your code to execute after the DOM is ready.
    For this jQuery provides the ready function.

    Call your FormatTable only after the DOM is ready as follows.

    ClientScript.RegisterClientScriptBlock(Me.GetType(), "FormatTable", 
                        @"$(document).ready(function() {FormatTable();});", True);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a following requirement for my asp.net page: User can add a textbox dynamically
I have following requirement, I have C#/.Net console application, which refers to 'System.Data.Sqlite.dll' 'System.Data.Sqlite.dll'
The requirement is following: I have to get the location field from page. var
Requirement specfication: Upload a picture from a webform (ASP.NET MVC application) to my database.
Following on from this question: ASP.NET MVC Routing with Default Controller I have a
I have a requirement of building an Inertial Measurement Unit (IMU) from the following
I have the following requirement: Based on some user input, I need to generate
I have the following requirement. I have a table with a column that contains
Consider the following code (from a requirement that says that 3 is special for
I have a requirement to print a bill from the AIR application. Following are

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.