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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:33:25+00:00 2026-05-20T17:33:25+00:00

I write ASP.NET application and I want to use jQuery DataTables. In Master Page

  • 0

I write ASP.NET application and I want to use jQuery DataTables.

In Master Page (which is not in root) I include scripts in code behind:

protected override void OnInit(EventArgs e)
{
    base.OnInit(e);

    ScriptManagerSM.Scripts.Add(new ScriptReference(Page.ResolveUrl("~/js/jquery.min.js")));
    ScriptManagerSM.Scripts.Add(new ScriptReference(Page.ResolveUrl("~/js/jquery-ui.min.js")));
    ScriptManagerSM.Scripts.Add(new ScriptReference(Page.ResolveUrl("~/js/DataTables/jquery.dataTables.js")));
    ScriptManagerSM.Scripts.Add(new ScriptReference(Page.ResolveUrl("~/js/setup.js")));
    Page.Header.DataBind();
}

In page I have just pure html:
<table class="table display">
<thead>
<tr>
<th>Header</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr class="gradeX">
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</tbody>
</table>

jQuery is called by class selector in my setup.js:
$(function() {
var oTable = $('.table').dataTable( {
"bJQueryUI": true,
"sScrollX": "",
"bSortClasses": false,
"aaSorting": [[0,'asc']],
"bAutoWidth": true,
"bInfo": true,
"sScrollY": "100%",
"sScrollX": "100%",
"bScrollCollapse": true,
"sPaginationType": "full_numbers",
"bRetrieve": true
} );
});

Everything is working on pages placed in root. But on pages in subfolders jQuery is not fired. It looks like some path trouble, but I can’t see.

Thanks for help o..o

edit: setup script added
edit 2: added calling of jQuery
edit 3: added $(function() { to js code above (already existing in my real code, just missing here

  • 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-20T17:33:26+00:00Added an answer on May 20, 2026 at 5:33 pm

    The document needs to load before you run this so change this:

    var oTable = $('.table').dataTable( {
    "bJQueryUI": true,
    "sScrollX": "",
    "bSortClasses": false,
    "aaSorting": [[0,'asc']],
    "bAutoWidth": true,
    "bInfo": true,
    "sScrollY": "100%",
    "sScrollX": "100%",
    "bScrollCollapse": true,
    "sPaginationType": "full_numbers",
    "bRetrieve": true
    } );
    

    To this:

    $(function(){
    
    var oTable = $('.table').dataTable( {
    "bJQueryUI": true,
    "sScrollX": "",
    "bSortClasses": false,
    "aaSorting": [[0,'asc']],
    "bAutoWidth": true,
    "bInfo": true,
    "sScrollY": "100%",
    "sScrollX": "100%",
    "bScrollCollapse": true,
    "sPaginationType": "full_numbers",
    "bRetrieve": true
    } );
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my ASP.NET MVC 3 application I want to use Jquery's pagination plugin to
I have created blank Asp.Net-MVC 3 web application and want to write my own
How can I write an ASP.NET (C#) application that will render a page can
I want to localize Web Service in ASP.NET application. I can write the following
I have a GridView and want to on an ASP.NET Web Application page and
i want to use this plugin in my asp.net application i want to show
I'm trying to write an ASP.NET MVC application where user privilege is based upon
I'm trying to write a log file from an ASP.NET application under IIS7, but
I'm trying to write a log file from an ASP.NET application under IIS7, but
We are starting to write more and more code for an ASP.Net web application

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.