Web.BarcodeControl

TECIT.TBarCode.Web.BarcodeControl

Base types: WebControl, INamingContainer

An ASP.NET 4.5 control which renders a barcode.

There are two ways to set the data of the barcode:

  • The contents of the barcode can be set directly by using the property Barcode.TECIT.TBarCode.Barcode.Data.

  • The Barcode control can be bound to another control on the same page (see property Source). The contents of the source control will be encoded in the barcode.

The Refresh Button:
By default, the control contains a "Refresh" button that needs to be clicked by a user to update the barcode.
The "Refresh" button can be disabled and hidden. In this case the application needs to call Refresh to update the barcode.

Barcode Resolution:
The barcode can be optimized for different resolutions. The default resolution is the screen resolution (96 dpi). This ensure that the barcode will be readable directly on the screen. By setting a higher resolution (see Barcode.TECIT.TBarCode.Barcode.Dpi) the barcode can be optimized for other output devices.
For example, when setting 600 dpi the barcode (in most cases) won't be readable in the web browser. But the barcode will be perfectly readable when printing the web page on a 600 dpi printer.
(Background info: The resolution of the barcode is handled the following way: First we assume that the screen resolution is 96 DPI, which should fit most monitors. Then the barcode image is drawn bigger depending on the desired resolution. For example, if the desired resolution is 192 DPI then the image is rendered twice as big. The barcode image is then display in the web control using the original size. I.e. the web browser shows a scaled down image. If you zoom in (e.g. in Opera browser) or if you print the page, the barcode will be drawn with the correct resolution (e.g. 192 DPI).

Barcode cache:
The barcode images are temporarily cached on the web server (see CacheType). When barcodes are cached in memory then a BarcodeHttpHandler needs to be installed for the web application. This achieved by adding a single line to the web.config file of the application (see BarcodeHttpHandler).

Constructors

NameDescription
BarcodeControlConstructor.

Methods

NameDescription
CreateChildControlsIs called to create the child controls of this control.
RefreshSet the refresh flag.

Properties

NameDescription
BarcodeGets or sets the barcode properties.
BarcodeIdRetrieves or sets the identifier of the current barcode image.
BarcodeImageExistsRetrieves whether the barcode image already exists.
ButtonHeightGets or sets the height of the "Refresh" button.
ButtonTextGets or sets the height of the "Refresh" button.
ButtonWidthGets or sets the width of the "Refresh" button.
CacheRetrieves or sets the location where the barcode images shall be cached.
CacheDirectoryRetrieves or sets the local directory in which the bar codes shall be cached.
CacheTimeRetrieves or sets the time span [min] that a barcode image is cached for.
ColorDepthGets or sets the color depth of the barcode bitmap.
ErrorHandlingGets or set kind of error handling.
HeightRetrieves or sets the height of the barcode control.
ImageFormatGets or sets the image format of the barcode bitmap.
ImageHeightRetrieves the actual height of the barcode image.
ImageUrlRetrieves the URL of the barcode image.
ImageWidthRetrieves the actual width of the barcode image.
ShowButtonGets or sets the visibility of the Refresh-button.
SourceRetrieves or sets the control ID of the data source.
SpacingGets or sets the minimal space between the barcode area and the Refresh button [px].
WidthRetrieves or sets the width of the barcode control.

Search documentation

Search in
More scopes
Additional scopes

All contents