LinkButton点击后鼠标边沙漏,在导出运行完后变回原来的样子
点击按钮之后样式改了,可是无法恢复,急求解决方法,谢谢各位高手了,以下是代码
*.ascx:
javascript:
function mousewait() {
var temp1 = '<% = LBtn_Export.ClientID %>';
document.getElementById(temp1).style.cursor = 'wait';
}<asp:LinkButton ID="LBtn_Export" runat="server" OnClientClick = "mousewait()" onclick="LBtn_Export_Click">导出数据</asp:LinkButton>*.csprotected void LBtn_Export_Click(object sender, EventArgs e)
{
string strTempFilePath = _presenter.Data();
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
string fileName = (strTempFilePath.Substring(strTempFilePath.LastIndexOf('/') + 1)).Split('.')[0] + "_" + DateTime.Now.ToString("yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo) + ".xls"; ;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.ContentEncoding = System.Text.Encoding.Unicode;
Response.ContentType = "application/vnd.ms-excel
Response.WriteFile(strTempFilePath);
GC.Collect();
Response.Flush();
string deleteguid = strTempFilePath.Substring(0, strTempFilePath.LastIndexOf('/'));
File.Delete(strTempFilePath);
Directory.Delete(deleteguid);
Response.End();
}
点击按钮之后样式改了,可是无法恢复,急求解决方法,谢谢各位高手了,以下是代码
*.ascx:
javascript:
function mousewait() {
var temp1 = '<% = LBtn_Export.ClientID %>';
document.getElementById(temp1).style.cursor = 'wait';
}<asp:LinkButton ID="LBtn_Export" runat="server" OnClientClick = "mousewait()" onclick="LBtn_Export_Click">导出数据</asp:LinkButton>*.csprotected void LBtn_Export_Click(object sender, EventArgs e)
{
string strTempFilePath = _presenter.Data();
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
string fileName = (strTempFilePath.Substring(strTempFilePath.LastIndexOf('/') + 1)).Split('.')[0] + "_" + DateTime.Now.ToString("yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo) + ".xls"; ;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.ContentEncoding = System.Text.Encoding.Unicode;
Response.ContentType = "application/vnd.ms-excel
Response.WriteFile(strTempFilePath);
GC.Collect();
Response.Flush();
string deleteguid = strTempFilePath.Substring(0, strTempFilePath.LastIndexOf('/'));
File.Delete(strTempFilePath);
Directory.Delete(deleteguid);
Response.End();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货