title: how to give print(dot matrix printer) in asp.net
body: <p>In my project i have to print a form, like name, age etc. Its all printed in print paper, i just have to place name , age according to paper. currently i am using a asp.net page to serve my purpose.where i have put labels with position = absolute. when i click on print i am calling that page , in onload event i am putting label values based on previous page content. </p>
  
  <p>it is simple. so is there any better way to print in dotmatrix printer or not? please suggest.</p>
  
  <p>Now prnting works fine, but problem is when i click on print button i am opening that page like popup window and invoke print there. but i want that pop up window to closed after i click print or cancel button. please help me.</p>
  
  <p>my code is like this: </p>
  
  <p>This BtnPrint is in my main page. Main page contains inputs like name, age and etc.
  In PrtPage i have placed labels according to space given for printing.So i am loding main page values in onload event of PrtPage.aspx.</p>
  
  <p>protected void BtnPrint_Click(object sender, EventArgs e)</p>
  
  <pre><code>{
  
      Response.Write("&lt;script&gt;");
      Response.Write("window.open('PrtPage.aspx','_blank')");
      Response.Write("&lt;/script&gt;");
  }
  </code></pre>
  
  <p>in page load of PrtPage:</p>
  
  <p>protected void Page_Load(object sender, EventArgs e)</p>
  
  <pre><code>{
  
       Response.Write("&lt;script&gt;");
       Response.Write("window.print()");
       //Response.Write("window.close()");
       Response.Write("&lt;script&gt;");
  }
  </code></pre>
  
  <p>but whenever i click on print button it asks ' u want to close window?', so please help me in this. i want to close after i click on print or cancel in print setup window.</p>
  
  <p>or suggest me if there is any good method for printing in dotmatrix..
  Thanks in advance.</p>
  
  <p>Sam.</p>