Customizing the CSS for pagination in an Asp GridView displays correctly in the Design View, but does not

Using Bootstrap, I have implemented custom CSS for pagination in a gridview. My master page includes:

<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

In the aspx page, my gridview code looks like this:

<asp:GridView ID="grid_view_search" runat="server" onprerender="GridView_PreRender" DataSourceID="sql_data_source_search" AutoGenerateColumns="False" DataKeyNames="ID" CssClass="table table-hover table-condensed table-bordered" AllowSorting="True" AllowPaging="True">
            <Columns>
               //Columns here
            </Columns>
            <PagerSettings Mode="NumericFirstLast" />
            <PagerStyle CssClass="pagination-bootstrap" HorizontalAlign="Center" />
        </asp:GridView>

Everything is styled correctly except for "pagination-bootstrap", which appears as the default style in the browser (i.e. 12). However, in design view, it displays as intended (i.e. [1][2]).

I've tried adding the style directly to the gridview opening tag line but it hasn't made a difference. Most online solutions mention using "~/css" for file paths, but that doesn't seem to be the issue as other styles from style.css are working fine.

Any assistance would be greatly appreciated.

[Edit] Images of design view and browser view have been added below:

Design View:

Browser:

Answer №1

After some investigation, I discovered that the issue was caused by CSS caching. To resolve it and see the updated CSS file for pagination, I simply had to use the Ctrl-F5 shortcut to refresh the page.

Answer №2

Don't miss the chance to read the article "Implementing Bootstrap Pagination on Gridview" Check it out here

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ordering tables in jQuery with both ascending and descending options

Trying to sort a table in ascending and descending order using jQuery? Here's the JavaScript code for it. However, encountering an error: Cannot read property 'localeCompare' of undefined If you can provide guidance on how to fix this so ...

Ways to prevent continuous database record creation when refreshing the page

My form for adding records to the database looks like this: <form class="col s12" action="" method="post"> <div class="row"> <div class="input-field col s6"> <input placeho ...

Is it possible to design this layout within a flex container while ensuring the specific order of elements remains intact for potential future swaps?

Check out this example layout <div class="flex"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item"& ...

Ways to ensure that both the Search text field and search button are of equal height

I am facing an issue with the layout of my HTML code within my ASP.NET MVC web application. Below is the snippet of code causing the problem: <form class="customSearch" method="GET" action="@Url.Action("Search", "Home")"> <input class="searchIn ...

Binding dropdown lists for states and cities using database connections

Can anyone suggest a simple method to populate a dropdown list with states and then have the corresponding cities dynamically display in the next dropdown when a state is selected? I have already assigned a StateID to the City Table for this purpose. ...

Adding Firebase Data to Vue Table

I am currently utilizing Vue Table JS, which can be found at https://github.com/matfish2/vue-tables-2 <script type="text/javascript"> Vue.use(VueTables.ClientTable); new Vue({ el: "#app", data: { columns: ['name', 'code', ...

Organizing DIVs upon website initialization

My website features a layout with three columns: <div id="column1"></div> <div id="column2"></div> <div id="column3"></div> I currently have 3 divs on the webpage: <div id="1">aaa</div> <div id="2">b ...

A guide on incorporating the close button into the title bar of a jQuery pop-up window

Check out this fiddle: https://jsfiddle.net/evbvrkan/ This project is quite comprehensive, so making major changes isn't possible. However, the requirement now is to find a way to place the close button for the second pop-up (which appears when you c ...

Exploring the retrieved data from the AJAX/ASP.NET controller update for a fresh perspective

When selectbox is called, it triggers the 'getDepAndMan()' function. A value is extracted from the selectbox (successful). The function calls methods in the 'GetDepartmentAndManager' controller (successful). The controller returns ...

Which method can be used in ASP.NET base page to override and customize HTTP headers?

Incorporating a custom HTTP header for all pages inheriting from a base class is my current focus. How can I achieve this by overriding a method within the base class? ...

Toggle button state during thread execution in asp.net

When I click the button in my ASP.NET web application, I have a thread that is supposed to disable the button and perform some background tasks. The background tasks are working fine, but for some reason the button disabling part is not functioning as expe ...

Achieving vertical alignment of button contents in Bootstrap 4

Incorporating bootstrap 4 and material icons into my app has presented a challenge. Specifically, the issue arises when I attempt to create a button that contains both text and an icon. .button-icon { vertical-align: middle; } <button class="button ...

Tips on inline password field placement for a better user interface experience?

While creating a registration form, I ran into a user interface problem. There are two specific changes I'd like to make: The label for Confirm Password should be inline on the same line. The password input should have an eye icon embedded within it ...

Styling HTML elements with CSS to create a full width underline effect

Is there a way to make the underlines/borders full width for each line in a paragraph without adding line breaks? I'm seeking suggestions on how to achieve this. Two potential solutions I've considered are using the tag or creating an image, ...

How to navigate to the "not now" button in Instagram notifications with Selenium and Python

I'm currently working on a custom "Instagram bot" to log in to Instagram. Although I've managed to bypass the login screen, I'm encountering an issue with a popup message that says: https://i.stack.imgur.com/OMA6h.png from selenium import we ...

What's causing this bootstrap button to act up?

https://i.sstatic.net/9ZAz9.png It was expected that the button would appear on the right side while the navigation titles would be displayed on the left. <nav id="mainNavbar" class="navbar navbar-dark bg-dark navbar-expand-md"> ...

The color change functions are functional in IE9 and Firefox, but may not be compatible with earlier versions of IE or Chrome

A JavaScript function is used to change the colors of CSS rendered images in Internet Explorer 9 and Firefox. Is there a workaround for this issue or is it related to the code on the page? You can see this in action at . <!DOCTYPE html PUBLIC &quo ...

Can you apply Bootstrap 5 custom color directly to the class attribute?

just like this: <span class="text-primary">some text</span> I'm curious if there's a way to achieve the following: <span class="text-red-300">some text</span> The red-300 color in Bootstrap 5 is a c ...

Implementing the @media rule using Javascript

I'm trying to use JavaScript to add an image dynamically, but I want to remove it when the viewport is 600px or wider. This is my approach so far: var img = document.createElement('img'); // (imagine here all the other fields being defined ...

Restore the RadGrid to its previous state following a rebind operation

I am currently working on reconfiguring a Hierarchical radgrid after closing a custom edit/insert form by implementing the following code and JavaScript. My goal is to restore the Grid to its original state when the user clicked to edit a record. Presently ...