Barcode Creator Web Control on pages can run in both Visual Studio and IIS web applications. Before using, you need download pqScan Barcode Creator SDK firstly.
How to Generate EAN-13 in ASP.NET Web Server?
ASP.NET EAN-13 Creator is one of the barcode generation functions in pqScan Barcode Creator for ASP.NET. At the same way to other types of barcode, generating EAN-13 through Barcode Creator Web Control is most convenient for developers.
If you want to learn more about creating barcodes in ASP.NET application, you can see Date Matrix in web, PDF417 in web, QR Code in web, Aztec Code in web.
Using the pqScan Barcode Creator WebForms control to render EAN-13 image, follow these steps:
- Unzip the downloaded Trial package to development computer.
- Add Barcode Creator Webforms Control to the Visual studio Toolbox.
- In the ASP.NET Web application, show the ToolBox pane.
- Right click on the General pane and select Choose Items...
- In the pop-up dialog Choose Toolbox Items, ensure the .NET Framework Components tab is displayed.
- Push the Browse button and navigate to the "PQScan.BarcodeCreator.dll" file.
- Ensure the checkbox "BarcodeWebControl" is checked.
- With a project's web form open in design mode, drag the "BarcodeWebControl" item from toolbox onto the web form.
- Copy "BarcodeWebHandler.ashx" file in to your ASP.NET web site.
- Unzip the downloaded Trial package to development computer.
- Publish you APS.NET web site to your IIS.
- Copy "PQScan.BarcodeCreator.dll" file to your IIS bin forder.
- Copy "BarcodeWebHandler.ashx" file to your IIS root path.
- Create an empty html at root path, insert an image tag like this: <img src="http://localhost:port/BarcodeWebHandler.ashx?BarType=EAN13&Data=123456789012&Width=200&Height=100&ShowText=True"/>
- Viewing html page on web browser, you will see the EAN-13 barcode made on the page.
Note: When you use pqScan Barcode Creator Web Control to encode EAN-13, please ensure the "BarcodeWebHandler.ashx" file is copied to the folder where the web pages you want to generate EAN-13 barcodes in both ways above.
Note: Generating a EAN-13 barcode image both in Visual Studio web site and in IIS, the src property of <img> tag can be changed by javascript to customize barcode image, and there is no need to refresh whole web page.
To encode EAN-13 image in web form class using Barcode Creator methods of Library, follow these steps:
- Download and unzip the Trial package to development computer.
- Add "PQScan.BarcodeCreator.dll" to your ASP.NET Web form project reference.(The DLL will be copied automatically to the project bin folder).
- Add following C# code to your ASP.NET Web from class:
using System; using System.Web; using System.Web.UI; using PQScan.BarcodeCreator; namespace EAN13GeneratorInWeb { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Barcode ean13 = new Barcode(); ean13.Data = "123456789012"; ean13.BarType = BarCodeType.EAN13; ean13.Width = 200; ean13.Height = 100; ean13.ShowText = true; ean13.CreateBarcode("ean13-webforms.png"); } } }