This example illustrates how you can use our new Bar Code Library in ASP.NET to generate and display a barcode image on the webpage. The best approach implies creating a custom HTTP Handler that will generate and output an image. Here is a code of this handler:
[C#]publicclassBarCodeHandler:IHttpHandler{publicvoidProcessRequest(HttpContextcontext){BarCodebarCode=newBarCode();barCode.Symbology=Symbology.QRCode;barCode.CodeText="123";context.Response.ContentType="image/png";barCode.Save(context.Response.OutputStream,ImageFormat.Png);context.Response.End();}publicboolIsReusable{get{returnfalse;}}}
The img tag in the main aspx page is defined as follows:
[ASPx]<imgsrc="BarCodeHandler.ashx"alt="QRCode"width="200px"height="200px"/>
See Also:
Example Comments
Added By: ABRAMO ABRAMO at: 6/14/2013 5:12:48 AM
I get Server Error in '/E4716' Application when I click "Run Online"
Added By: mariah sharp at: 7/31/2013 11:25:17 PMhave a look at this <a href="http://www.keepautomation.com/products/net_barcode_winforms/">barcode generator for winforms application</a>
Added By: mariah sharp at: 8/8/2013 5:33:13 AMdoes this <a href="http://www.keepautomation.com/products/net_barcode_winforms/">barcode generator in .net winforms </a>have the quality above