i want to print ID with Barcode
i am using this code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Width="144px"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="submit" />
<br />
<asp:TextBox ID="TextBox2" runat="server" Height="45px" Width="144px"></asp:TextBox>
<br />
<asp:Button ID="Button2" runat="server" Text="Print" />
</div>
</form>
</body>
</html>
i want to give iD in textbox1 and submit after submitting it Text Box 2 should get ID and Barcode both so that from there i can get print ... how can i do this process..
public void CreateBarcode(string data) {
imgPath = string.Format("{0}{1}.png", path, data);
Bitmap barcode = new Bitmap(1, 1);
Font threeOfNine = new Font("IDAutomationHC39M", 60,
System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point);
Graphics graphics = Graphics.FromImage(barcode);
SizeF dataSize = graphics.MeasureString(data, threeOfNine);
barcode = new Bitmap(barcode, dataSize.ToSize());
graphics = Graphics.FromImage(barcode);
graphics.Clear(Color.White);
graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixel;
graphics.DrawString(data, threeOfNine, new SolidBrush(Color.Black), 0, 0);
graphics.Flush();
threeOfNine.Dispose();
graphics.Dispose();
barcode.Save(imgPath);
}
protected void Button1_Click(object sender, EventArgs e)
{
CreateBarcode(TextBox1.Text);
}