IE在使用clientscript.registerstartup调用处理程序之前停止执行JavaScript
带有日历控件的文本框在文件下载后不会在IE中显示日历图像。确保已声明DOCTYPEIE在使用clientscript.registerstartup调用处理程序之前停止执行JavaScript,javascript,c#,jquery-ui-datepicker,Javascript,C#,Jquery Ui Datepicker,带有日历控件的文本框在文件下载后不会在IE中显示日历图像。确保已声明DOCTYPE ClientScript.RegisterStartupScript(this.GetType(), "load", "HideProgress ();window.location.href='DownloadFile.ashx';", true); Handler file: public class DownloadFile : IHttpHandler, System.Web.SessionState.I
ClientScript.RegisterStartupScript(this.GetType(), "load", "HideProgress
();window.location.href='DownloadFile.ashx';", true);
Handler file:
public class DownloadFile : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest (HttpContext context) {
if (context.Session["fileContent"] != null && context.Session["filename"] != null)
{
//Download the excel file
System.IO.StringWriter fileContent = (System.IO.StringWriter)context.Session["fileContent"];
string filename = context.Session["filename"].ToString();
context.Response.Clear();
context.Response.ClearHeaders();
context.Response.ClearContent();
context.Response.ContentType = "application/vnd.ms-excel";
context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
context.Response.Write(fileContent.ToString());
context.Response.Flush();
}
}
与用户代理指示器一起告诉IE使用可用的最新渲染引擎
<!DOCTYPE html>
我应该在哪里包括这些内容?应该是您文件中的第一条语句,应该在beginsI之后立即包含。我对此表示怀疑,但大多数与IE相关的问题[JS和CSS]都可以通过此解决,希望它也能帮助您!
<meta http-equiv="X-UA-Compatible" content="IE=edge">