The ASPX page is very simple and consists of a WebForms Image control, a label to show the raw text and a refresh button:
In the Page_Load event, the current date and time measured in ticks is passed as a QueryString to the ImageUrl property of the Image control. The URL is another ASPX page that uses TX Barcode .NET to create the barcode image.
In the Page_Load event of CreateBarcode.aspx, TX Barcode .NET is used to save the encoded string as a barcode image into a MemoryStream. This stream is returned using Response.BinaryWrite.
The HTML image element loads the image data dynamically from the CreateBarcode.aspx page. Every time, the Refresh button is clicked, the barcode is updated with the current date and time.
Download the sample from GitHub and test it on your own.
Download and Fork This Sample on GitHub
We proudly host our sample code on github.com/TextControl.
Please fork and contribute.
Requirements for This Sample
- Visual Studio 2012 or better
- TX Text Control .NET Server for ASP.NET (trial sufficient)