title: Print In Asp .Net With C#
body: <p>Recently I Have work in A Project Education Management System Which Is On Windows Application Using C#.net In That I am Use Print document Control To Print Mark sheet Layout And It work well.. But I Have To Convert It On Asp.net Web Site So Any Printing Method Which Print Mark sheet Layout Same Quality As Print Document And Content Of Mark sheet Fatch From Database. 
  Any Code Which Is Help Full To Print In C# , Java Script .  Any code related to printing but print quality is necessary because of mark sheet printing</p>
  
  <p>I have code its window appilcation Related Code But I Want Web Based Solution </p>
  
  <pre><code>private void printDocument2_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
      {
          e.Graphics.DrawRectangle(Pens.Black, rectangleShape1.Location.X, rectangleShape1.Location.Y, rectangleShape1.Width, rectangleShape1.Height);
          //////////////////////////////
          e.Graphics.DrawString(label24.Text, label24.Font, Brushes.DarkBlue, label24.Location.X, label24.Location.Y);
          e.Graphics.DrawString(label25.Text, label25.Font, Brushes.DarkBlue, label25.Location.X, label25.Location.Y);
          e.Graphics.DrawString(label26.Text, label26.Font, Brushes.Brown, label26.Location.X, label26.Location.Y);
          e.Graphics.DrawString(label27.Text, label27.Font, Brushes.Black , label27.Location.X, label27.Location.Y);
          e.Graphics.DrawString(label28.Text, label28.Font, Brushes.Black, label28.Location.X, label28.Location.Y);
          e.Graphics.DrawString(label29.Text, label29.Font, Brushes.Black, label29.Location.X, label29.Location.Y);
          e.Graphics.DrawString(label30.Text, label30.Font, Brushes.Black, label30.Location.X, label30.Location.Y);
          e.Graphics.DrawString(label31.Text, label31.Font, Brushes.Black, label31.Location.X, label31.Location.Y);
           ////////////////////////////
          e.Graphics.DrawString(txtRollno.Text, txtRollno.Font, Brushes.Black, txtRollno.Location.X, txtRollno.Location.Y);
          e.Graphics.DrawString(txtName.Text, txtName.Font, Brushes.Black, txtName.Location.X, txtName.Location.Y);
          e.Graphics.DrawString(txtfathernameid.Text, txtfathernameid.Font, Brushes.Black, txtfathernameid.Location.X, txtfathernameid.Location.Y);
          e.Graphics.DrawString(txtAddress.Text, txtAddress.Font, Brushes.Black, txtAddress.Location.X, txtAddress.Location.Y);
          e.Graphics.DrawString(txtContact.Text, txtContact.Font, Brushes.Black, txtContact.Location.X, txtContact.Location.Y);
      ////////////////
          e.Graphics.DrawImage(pictureBox1.Image, pictureBox1.Location.X, pictureBox1.Location.Y, pictureBox1.Width, pictureBox1.Height);
      }
  
  
   private void btnPrintPreview2_Click(object sender, EventArgs e)
      {
          printPreviewDialog1.Document = printDocument2;
          printPreviewDialog1.Show Dialog();
      }
  </code></pre>