我的页面上有一个GridView
和一个按钮,点击按钮后怎么刷新GridView//绑定代码
private void FillGrid()
{
//........
this.GridView1.DataSource = ds.Tables[0];
this.GridView1.DataBind();
}//下载代码
public void ExportDate(string FileType ,string strContent,string ExpID,string FileName)
{
Response.Clear();
Response.Charset = "gb2312";
Response.ContentEncoding = Encoding.GetEncoding("gb2312");
Response.HeaderEncoding = Encoding.GetEncoding("gb2312");
Response.ContentType = FileType;//image/JPEG;text/HTML;image/GIF;wnd.ms-excel/msword; application/ms-excel
Response.AppendHeader("Content-Disposition", "attachment;filename="+FileName);
Response.Write(strContent.ToString());
Response.End();
} //点击按钮
private void btnDownLoad_Click(object sender,EventArgs e)
{
ExportDate(参数略);
FillGridView();
}这样更新不了,怎么解决?谢谢,分不多
和一个按钮,点击按钮后怎么刷新GridView//绑定代码
private void FillGrid()
{
//........
this.GridView1.DataSource = ds.Tables[0];
this.GridView1.DataBind();
}//下载代码
public void ExportDate(string FileType ,string strContent,string ExpID,string FileName)
{
Response.Clear();
Response.Charset = "gb2312";
Response.ContentEncoding = Encoding.GetEncoding("gb2312");
Response.HeaderEncoding = Encoding.GetEncoding("gb2312");
Response.ContentType = FileType;//image/JPEG;text/HTML;image/GIF;wnd.ms-excel/msword; application/ms-excel
Response.AppendHeader("Content-Disposition", "attachment;filename="+FileName);
Response.Write(strContent.ToString());
Response.End();
} //点击按钮
private void btnDownLoad_Click(object sender,EventArgs e)
{
ExportDate(参数略);
FillGridView();
}这样更新不了,怎么解决?谢谢,分不多
解决方案 »
- 我是新手,求一个假如dataset中有200条员工的信息,怎么根据部门ID分别生成xml的实例。
- 高分求高手解决一个安全异常问题!解决可多加分!
- ASP.NET AJAX安装后VS工程模板丢失的问题
- 高手请教?欢迎讨论。
- ASP控件和HTML控件的关系
- imagebutton问题,江湖救急
- VS2003新建web运用程序时,提示奇怪错误。
- 请教高手,后端代码如何控制html控件(不是web服务器控件)
- 有关数据库的问题
- VS.net生成的代码,错在那里a ?
- asp.net自定义控件怎么不显示呢?
- 我想问下怎么实现把图片以image格式保存到数据库中,还有怎么从数据库中读出图片格式并显示到页面上哦??
//点击按钮
private void btnDownLoad_Click(object sender,EventArgs e)
{
ExportDate(参数略);
FillGrid();
}
改成FillGrid()应该就可以了