How To: Barcode WPF in ASP.NET Web Applications
Technologies used
- Neodynamic Barcode Professional for WPF (any version)
- Microsoft .NET Framework 3.5 (ASP.NET 3.5) or greater
- Microsoft Visual Studio 2008
- Microsoft Visual Web Developer 2008 Express Edition (VWD)
|
 |
This walkthrough illustrates how easily you can use Barcode Professional for WPF in ASP.NET Web Applications. Barcode Professional for WPF leverages new WPF Drawing API generating high quality barcodes. Barcode Professional for WPF features raster barcode image generation which is useful in scenarios like ASP.NET Web Applications that need to display/deliver barcode to Internet Browsers.
During the course of this walkthrough, you will accomplish the following activities:
- Create an ASP.NET Web Site using Visual Studio 2008 or VWD 2008 Express Edition.
- Create a simple ASP.NET WebForm (ASPX) to dynamically generate barcodes.
- Create an ASP.NET HTTP Handler (ASHX) for barcode generation by leveraging Barcode Professional for WPF
Please follow these steps:
- Ensure you have installed Barcode Professional for WPF
- Launch Visual Studio 2008 or VWD 2008 and create a new ASP.NET Web Site
- Add a reference to Barcode Professional for WPF assembly (Neodynamic.WPF.Barcode.dll)
- Open Default.ASPX file at design time and in the Source View paste the following content:
-
In Design View, double click on "Barcode Now!" button and paste the following code in the Button's Click event handler:
Visual Basic .NET
Visual C# .NET
-
Add a new item of type "Generic Handler" and name it BarcodeGen.ASHX. In this ASP.NET Handler, we'll create an instance of BarcodeBuilder class (part of Barcode Professional for WPF) for barcode generation. As you'll realize, the code is very simple and straightforward. So after file creation, open it and paste the following code:
Visual Basic .NET
Visual C# .NET
- That's it. Run your project from VS. You'll get something like the following figure:
Barcode WPF in ASP.NET Web Applications (Internet Explorer Browser)
Barcode WPF in ASP.NET Web Applications (Mozilla Firefox Browser)
Sample Files Download
Here are the VB.NET and C# versions of this sample. Please
download the zip file and extract it.
Remember to download and install Barcode Professional for WPF in order to
reproduce this sample demo.
If you need more information or assistance, please contact our
.
|