I'm in a asp.net c# project. I want to print employees card with bar code. So I write a html tag in string variable call htmlCon and it will bind a DIV tag in client side (get all employees and loop it for print one by one).
it work fine. but inside the htmlCon variable has java script function it will not run in loop.
protected void btnGenarate_ClickEvent(object sender, EventArgs e)
{
......
foreach (var item in empDetails)
{
htmlCon += ..........+
"<script>"+
"$(document).ready(function ()"+
"{ $('#barcode').JsBarcode('"+ item.EmployeeNo + "', { width: 1, height: 30 }); });"+
"</script>" +
"<img id='barcode' class='barcode'/>" +
"........................................"+
}
}
this code comes with bar code and it will print first round in the loop..I want to run all employees for get bar code.