代码如下:…………………………
public void ExportToExcel(Control ctrl, String FileName)
    {
        GridView gv = (GridView)ctrl;
        gv.AllowPaging = false;//清除分页 
        gv.AllowSorting = false;// 清除排序
        GetExcel();
        HttpContext.Current.Response.Charset = "GB2312";
        HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
        HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        HttpContext.Current.Response.ContentType = "application/ms-excel";
        HttpContext.Current.Response.Write(AddExcelHead());
        StringWriter tw = new StringWriter();
        HtmlTextWriter hw = new HtmlTextWriter(tw);
        gv.RenderControl(hw);
        HttpContext.Current.Response.Write(tw.ToString());
        HttpContext.Current.Response.Write(AddExcelbottom());//网格
        HttpContext.Current.Response.End();
        gv.AllowSorting = true; //恢复分页 
        gv.AllowPaging = true; //恢复排序 
        GetData2();
    }
public void GetExcel()
    {
        GridView2.DataSource = B_FileInfo1.GetExcle("'%,'+'" + Session["Townid"].ToString() + "'+',%' and b.townid='" + Session["Townid"].ToString() + "'" + " and FdataTime between '" + before.Value + "' and '" + later.Value + "'");
        GridView2.DataBind();
    }
private void GetData2()
    {
        GridView2.DataSource = B_FileInfo1.GetExcle("'%,'+'" + Session["Townid"].ToString() + "'+',%' and b.townid='" + Session["Townid"].ToString() + "'" + " and FdataTime between '" + before.Value + "' and '" + later.Value + "'");
        GridView2.DataBind();
    }
……………………………………
public override void VerifyRenderingInServerForm(Control control)
    {
    }调试了一下,发现是以下代码没有运行
public override void VerifyRenderingInServerForm(Control control)
    {
    }
这个要怎么办呢?
求助