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字?符?编括
如果本文引用了你的文章而未注明,请及时联系我。
原文地址:https://www.cnblogs.com/sunxi/p/2571623.html