Gridview 导出excel

using System;

using System.Collections.Generic;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;



public partial class others_test3 : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {



    }



    #region 导?出?为aExcel    

    public override void VerifyRenderingInServerForm(Control control)    

    {       

        // Confirms that an HtmlForm control is rendered for    

    }

    private void ToExcel(Control ctl, string FileName)   

    {       

        HttpContext.Current.Response.Charset = "UTF-8";   //获?取?http字?符?编括

 

你可能感兴趣的:(GridView)