Barcode Professional for ASP. NET use Tutorial: HTML page Display barcode

Source: Internet
Author: User

Sometimes we need to display barcodes on HTML pages. Today to share with you in barcode Professional, how to display barcodes on HTML.

Steps:

    • Open it. NET development tools, such as Visual Studio. Net. Create a new ASP. NET Web Application
    • For the barcode to be displayed on the HTML page, we need to create an ASP. WebForm and HTTP Handler.
    • Add references to Barcode Professional
    • In the barcodegen.aspx ' s code file, add the following space to name the reference

Vb

Imports Neodynamic.WebControls.BarcodeProfessional

C#

using Neodynamic.WebControls.BarcodeProfessional;

    • Barcodegen.aspx page will receive the encoded parameters through the string query, in the Page_Load event, you can use barcode Professional to generate barcodes, refer to the following code:

Vb

DimBcp as NewBarcodeprofessionalbcp.code= Request.QueryString ("Code") bcp. Symbology=symbology.code128DimBarcodeimage as Byte() =bcp. Getbarcodeimage (System.Drawing.Imaging.ImageFormat.Gif)If(Barcodeimage is  Nothing) ThenResponse.End ()Elseresponse.clear () Response.ContentType="Image/gif"Response.BinaryWrite (Barcodeimage) response.end ()End If

C#

Barcodeprofessional bcp =Newbarcodeprofessional (); bcp. Code= request.querystring["Code"];bcp. Symbology=symbology.code128;byte[] Barcodeimage =bcp. Getbarcodeimage (System.Drawing.Imaging.ImageFormat.Gif);if(Barcodeimage = =NULL) Response.End ();Else{response.clear (); Response.ContentType="Image/gif"; Response.BinaryWrite (Barcodeimage); Response.End ();}

    • Add an HTML page that can be named barcodetest.htm, where script code can be used to add dynamic barcodes. Reference code:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
    • In this way, you create an ASP. NET Web application, open barcodetest.htm, enter the code, and click the "View Barcode" button to view the generated barcode.
original translation from Barcode

Barcode Professional for ASP. NET use Tutorial: HTML page Display barcode

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.