title: VerifyRenderingInServerForm(System.Web.UI.Control) while export grid view to pdf
body: <p>I have try to export data from gridview to pdf in normal .aspx it is working but when i try this in webusercontrl.ascx form it shownig error like   </p>
  
  <pre><code>    VerifyRenderingInServerForm(System.Web.UI.Control)': no suitable method found to override....
  </code></pre>
  
  <p>how can i export the data in webusercontrol.ascx please help me...
  Here is my code </p>
  
  <pre><code>     using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using System.Web.UI;
      using System.Web.UI.WebControls;
       using System.IO;
       using iTextSharp.text;
     using iTextSharp.text.html.simpleparser;
     using iTextSharp.text.pdf;
  
    namespace MortgageSaver
    {
        public partial class Paymentreportsviewcontrl : System.Web.UI.UserControl
         {
            MortgagesaverEntities mortgageentity = new MortgagesaverEntities();
            protected void Page_Load(object sender, EventArgs e)
            {
          if (!Page.IsPostBack)
          {
              if (Session["Username"] != null)
              {
  
                  if (Session["Loanid"] != null)
                  {
                      txtloanid.Text = Session["Loanid"].ToString();
                      grdviewPayments.Attributes.Add("bordercolor ", "#A4C2CE");
                     GetPaymentReport();
                  }
              }
              else
              {
                  Response.Redirect("AdminLogin.aspx");
              }
  
  
  
          }
  
      }
      private void GetPaymentReport()
      {
          try
          {
              string todate = txttodate.Text;
              string[] todatesplt = todate.Split('-');
              int todatemnth = Convert.ToInt32(todatesplt[0]);
              int todatedate = Convert.ToInt32(todatesplt[1]);
              int todateyr = Convert.ToInt32(todatesplt[2]);
  
              string fromdate = txtfromdate.Text;
              string[] frmdatesplt = fromdate.Split('-');
              int frmdatemnth = Convert.ToInt32(frmdatesplt[0]);
              int frmdatedate = Convert.ToInt32(frmdatesplt[1]);
              int frmdateyr = Convert.ToInt32(frmdatesplt[2]);
              DateTime start = new DateTime(frmdateyr, frmdatemnth, frmdatedate);
              DateTime end = new DateTime(todateyr, todatemnth, todatedate);
              int loanpaymentid = Convert.ToInt32(Session["Loanid"].ToString());
              var query = from p in mortgageentity.Payments
                          join D in mortgageentity.Debit_Method on p.Debit_Method_ID equals D.Debit_Method_ID
                          join pt in mortgageentity.Payment_Type on p.Payment_Type_ID equals pt.Payment_Type_ID
                          where (p.Client_Pmt_Date &gt;= start) &amp;&amp; (p.Client_Pmt_Date &lt;= end) &amp;&amp; (p.Loan_ID == loanpaymentid)orderby p.Client_Pmt_Date descending
                          select new
                          {
                              p.Pmt_ID,
                              p.Loan_ID,
                              p.Client_Pmt_Date,
                              p.MtgSvr_Pmt_Start_Date2,
                              D.Debit_Method_Desc,
                              p.Total_Debit_Amt,
                              p.CreditAmt,
                              p.LenderAmt,
                              pt.Payment_Type_Desc,
                              p.Return_Code,
                              p.Returned_Date
                          };
              grdviewPayments.DataSource = query.ToList();
              grdviewPayments.DataBind();
          }
          catch { }
  
      }
     protected string Getammount(object MonthPayAmt)
      {
          if (MonthPayAmt != "")
          {
              return "$" + MonthPayAmt;
          }
          else
              return null;
      }
     protected void btnviewreport_Click(object sender, EventArgs e)
     {
         grdviewPayments.Attributes.Add("bordercolor ", "#A4C2CE");
         GetPaymentReport();
  
     }
     public override void VerifyRenderingInServerForm(grdviewPayments)
     {
         /* Verifies that the control is rendered */
     }
     protected void btnemail_Click(object sender, EventArgs e)
     {
         Response.ContentType = "application/pdf";
         Response.AddHeader("content-disposition", "attachment;filename=UserDetails.pdf");
         Response.Cache.SetCacheability(HttpCacheability.NoCache);
         StringWriter sw = new StringWriter();
         HtmlTextWriter hw = new HtmlTextWriter(sw);
         grdviewPayments.AllowPaging = true;
         grdviewPayments.DataBind();
         grdviewPayments.RenderControl(hw);
         grdviewPayments.HeaderRow.Style.Add("width", "15%");
         grdviewPayments.HeaderRow.Style.Add("font-size", "10px");
         grdviewPayments.Style.Add("text-decoration", "none");
         grdviewPayments.Style.Add("font-family", "Arial, Helvetica, sans-serif;");
         grdviewPayments.Style.Add("font-size", "8px");
         StringReader sr = new StringReader(sw.ToString());
         Document pdfDoc = new Document(PageSize.A2, 7f, 7f, 7f, 0f);
         HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
         PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
         pdfDoc.Open();
         htmlparser.Parse(sr);
         pdfDoc.Close();
         Response.Write(pdfDoc);
         Response.End();
    }
  
  
  }
  </code></pre>
  
  <p>}</p>