Products Technologies Demo Docs Blog Support Company

This blog post contains outdated information.

The cited code snippets may be workarounds, and be part of the official API in the meantime.

Reporting: Styling the DocumentViewer for ASP.NET

TX Text Control .NET Server comes with the HTML5 based editor Web.TextControl and the cross-browser, cross-platform DocumentViewer 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 class and loaded into the DocumentViewer in ASP.NET applications. The user can navigate through the document in various zoom levels. Thanks…

Reporting: Styling the DocumentViewer for ASP.NET

TX Text Control .NET Server comes with the HTML5 based editor Web.TextControl and the cross-browser, cross-platform DocumentViewer 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 class and loaded into the DocumentViewer in ASP.NET applications. The user can navigate through the document in various zoom levels.

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" %>

<!DOCTYPE html>

<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.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

GitHub

Download and Fork This Sample on GitHub

We proudly host our sample code on github.com/TextControl.

Please fork and contribute.

Download ZIP

Open on GitHub

Open in Visual Studio

Requirements for this sample

  • Visual Studio 2012 or better
  • TX Text Control .NET Server (trial sufficient)

Related Posts

ASP.NETWindows FormsWPF

Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub

This article gives a quick overview of the new repositories, their structure and our plans for the future.


ASP.NETGitHubHTML5

Building a Touch-enabled Button Bar with Javascript

A ribbon bar is a user-friendly interface for desktop environments when users can utilize a mouse to navigate. On tablets or smart-phones, another, more touch-enabled, interface might be required.…


ASP.NETGitHubMail Merge

MailMerge: Merge Hyperlinks into Merge Fields

The Text Control Reporting Framework consists of the classes part of the namespace TXTextControl.DocumentServer including the MailMerge component, field adapters and WYSIWYG template editors for…


ASP.NETDocument Viewer.NET Server

ASP.NET DocumentViewer Sample Online

In TX Text Control Server for ASP.NET (incl. Windows Forms) 15.0, we introduced the ASP.NET DocumentViewer. The DocumentViewer is a completely new server component in TX Text Control 15.0. It…


ASP.NETASP.NET CoreDocument Viewer

High-Performance Text Replacement in Large DOCX Files using C# .NET

Learn how to efficiently replace text in large DOCX files using C# .NET and the ServerTextControl component from Text Control. This article demonstrates the performance benefits of using the…