# Reporting: Styling the DocumentViewer for ASP.NET

> The DocumentViewer component in TX Text Control .NET Server displays merged reports in a cross-browser viewer. Its appearance is fully customizable through CSS, including button backgrounds, toolbar styles, page backgrounds, rounded document corners, and page navigation animations.

> **Note:** This article is outdated and may no longer be accurate.

- **Author:** Bjoern Meyer
- **Published:** 2015-06-14
- **Modified:** 2026-07-17
- **Description:** The DocumentViewer component in TX Text Control .NET Server displays merged reports in a cross-browser viewer. Its appearance is fully customizable through CSS, including button backgrounds, toolbar styles, page backgrounds, rounded document corners, and page navigation animations.
- **2 min read** (238 words)
- **Tags:**
  - ASP.NET
  - Document Viewer
  - GitHub
  - Sample
- **Web URL:** https://www.textcontrol.com/blog/2015/06/14/reporting-styling-the-documentviewer-for-aspnet/
- **LLMs URL:** https://www.textcontrol.com/blog/2015/06/14/reporting-styling-the-documentviewer-for-aspnet/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2015/06/14/reporting-styling-the-documentviewer-for-aspnet/llms-full.txt
- **GitHub Repository:** https://github.com/TextControl/TextControl.DocumentViewer.Styles

---

[TX Text Control .NET Server](https://www.textcontrol.com/product/tx-text-control-dotnet-server/) comes with the HTML5 based editor [Web.TextControl](https://docs.textcontrol.com/textcontrol/asp-dotnet/ref.txtextcontrol.web.textcontrol.class.htm) and the cross-browser, cross-platform [DocumentViewer](https://docs.textcontrol.com/textcontrol/asp-dotnet/article.aspnet.viewer.htm) component to view reports and documents.

The *DocumentViewer* can be used when pure document viewing is required in web-based applications. Typically, templates are merged server-side with data using the [MailMerge](https://docs.textcontrol.com/textcontrol/asp-dotnet/ref.txtextcontrol.documentserver.mailmerge.class.htm) class and loaded into the *DocumentViewer* in ASP.NET applications. The user can navigate through the document in various zoom levels.

[![Reporting: Styling the DocumentViewer for ASP.NET](https://s1-www.textcontrol.com/assets/dist/blog/2015/06/14/a/assets/animation_documentviewer.webp "Reporting: Styling the DocumentViewer for ASP.NET")](https://s1-www.textcontrol.com/assets/dist/blog/2015/06/14/a/assets/animation_documentviewer.webp)

Thanks to pure HTML and CSS, the *DocumentViewer* can be easily styled and customized. This sample replaces the button background images, the overall button style and the background of the view itself. Additionally, the document is getting rounded corners and receives an animation when the user navigates through pages.

In order to apply the styles, simply add the *DocumentViewer.css* (download the project from our GitHub repository) to the *head* element of your ASPX page:

```
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs"
  Inherits="tx_documentviewer_style.index" %>

<%@ Register assembly="TXDocumentServer, Version=22.0.800.500, 
  Culture=neutral, PublicKeyToken=6b83fe9a75cfb638"
  namespace="TXTextControl.DocumentServer.Web" tagprefix="cc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>DocumentViewer Style Sample</title>
  <link href="DocumentViewer.css" rel="stylesheet" />
</head>
<body>
  <form id="form1" runat="server">
  <div>

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <ContentTemplate>
        <cc1:DocumentViewer ID="DocumentViewer1"
          runat="server" Height="400px" Width="795px" />
      </ContentTemplate>
    </asp:UpdatePanel>

  </div>
  </form>
</body>
</html>
```

Download the sample from GitHub and test it on your own.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub](https://www.textcontrol.com/blog/2023/01/08/official-tx-text-control-net-sample-applications-are-now-hosted-on-github/llms.txt)
- [Building a Touch-enabled Button Bar with Javascript](https://www.textcontrol.com/blog/2015/05/27/building-a-touch-enabled-button-bar-with-javascript/llms.txt)
- [MailMerge: Merge Hyperlinks into Merge Fields](https://www.textcontrol.com/blog/2015/05/15/mailmerge-merge-hyperlinks-into-merge-fields/llms.txt)
- [ASP.NET DocumentViewer Sample Online](https://www.textcontrol.com/blog/2009/05/15/aspnet-documentviewer-sample-online/llms.txt)
- [Building a TX Text Control Project with GitHub Actions and the Text Control NuGet Feed](https://www.textcontrol.com/blog/2026/02/09/building-a-tx-text-control-project-with-github-actions-and-the-text-control-nuget-feed/llms.txt)
- [High-Performance Text Replacement in Large DOCX Files using C# .NET](https://www.textcontrol.com/blog/2025/07/30/high-performance-text-replacement-in-large-docx-files-using-csharp-dotnet/llms.txt)
- [Document Viewer 33.2.1 Released: New Event and Bug Fixes](https://www.textcontrol.com/blog/2025/07/30/document-viewer-33-2-1-released-new-event-and-bug-fixes/llms.txt)
- [Building an ASP.NET Core Backend (Linux and Windows) for the Document Editor and Viewer](https://www.textcontrol.com/blog/2025/03/26/building-an-asp-net-core-backend-for-the-document-editor-and-viewer/llms.txt)
- [TX Text Control Document Editor and Viewer for Blazor Released](https://www.textcontrol.com/blog/2025/03/25/tx-text-control-document-editor-and-viewer-for-blazor-released/llms.txt)
- [Getting Started: Document Viewer for Blazor in ASP.NET Core](https://www.textcontrol.com/blog/2025/03/25/getting-started-document-viewer-for-blazor-in-asp-net-core/llms.txt)
- [Announcing Our Work on a Blazor Component for Document Editing and Viewing](https://www.textcontrol.com/blog/2025/01/24/announcing-our-work-on-a-blazor-component-for-document-editing-and-viewing/llms.txt)
- [Preparing Documents for E-Signing for Multiple Signers in .NET C#](https://www.textcontrol.com/blog/2024/11/13/preparing-documents-for-e-signing-for-multiple-signers-in-net-c-sharp/llms.txt)
- [ASP.NET Core: Use the Document Editor and Viewer in the Same Razor View](https://www.textcontrol.com/blog/2024/11/08/asp-net-core-use-the-document-editor-and-viewer-in-the-same-razor-view/llms.txt)
- [Optimizing Digital Signature Workflows: Starting with MS Word DOCX Files Instead of PDFs in C#](https://www.textcontrol.com/blog/2024/09/27/optimizing-digital-signature-workflows-starting-with-ms-word-docx-files-instead-of-pdfs-in-csharp/llms.txt)
- [Document Viewer: Setting the Rendering Mode](https://www.textcontrol.com/blog/2024/08/22/document-viewer-setting-the-rendering-mode/llms.txt)
- [View MS Word DOCX and PDF Documents using a .NET C# Document Viewer for ASP.NET Core and ASP.NET](https://www.textcontrol.com/blog/2024/08/08/view-ms-word-docx-and-pdf-documents-using-a-net-csharp-document-viewer-for-aspnet-core-and-aspnet/llms.txt)
- [Stay Up-To-Date: Document Viewer 32.3.1 Released](https://www.textcontrol.com/blog/2024/08/08/stay-up-to-date-document-viewer-32-3-1-released/llms.txt)
- [Getting Started Video Tutorial: How to Add Electronic and Digital Signatures to PDF Documents in ASP.NET Core C#](https://www.textcontrol.com/blog/2024/08/05/getting-started-video-tutorial-how-to-add-electronic-and-digital-signatures-to-pdf-documents-in-asp-net-core-csharp/llms.txt)
- [Getting Started Video Tutorial: How to use the Document Viewer in ASP.NET Core C#](https://www.textcontrol.com/blog/2024/08/05/getting-started-video-tutorial-how-to-use-the-document-viewer-in-asp-net-core-csharp/llms.txt)
- [Transforming Financial Documents into Smart and Secure Forms in ASP.NET Core C#](https://www.textcontrol.com/blog/2024/05/01/transforming-financial-documents-into-smart-and-secure-forms-in-asp-net-core-c-sharp/llms.txt)
- [Document Viewer: Long Polling Support for Loading Documents](https://www.textcontrol.com/blog/2024/04/25/document-viewer-long-polling-support-for-loading-documents/llms.txt)
- [Adding and Sharing Annotations across Document Types using the Document Viewer in ASP.NET Core C#](https://www.textcontrol.com/blog/2024/04/19/adding-and-sharing-annotations-across-document-types-using-the-document-viewer-in-asp-net-core-c-sharp/llms.txt)
- [Adding a Security Middleware to ASP.NET Core Web Applications to Protect TX Text Control Document Editor and Document Viewer Endpoints](https://www.textcontrol.com/blog/2024/03/18/adding-a-security-middleware-to-asp-net-core-web-applications-to-protect-tx-text-control-document-editor-and-document-viewer-endpoints/llms.txt)
- [Building an ASP.NET Core Backend Application to Host the Document Editor and Document Viewer](https://www.textcontrol.com/blog/2024/03/14/building-an-asp-net-core-backend-application-to-host-the-document-editor-and-document-viewer/llms.txt)
- [Document Viewer 32.2.1 Released](https://www.textcontrol.com/blog/2024/03/13/document-viewer-3221-released/llms.txt)
