[英]Script manager not calling with HttpContext
當我使用
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "TTTT111", "alert('calling dfdfd from server .....');", true);
之前或之后
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = strContentType;
HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}", strFileName));
HttpContext.Current.Response.OutputStream.Write(ExportDataString, 0, ExportDataString.Length);
HttpContext.Current.ApplicationInstance.CompleteRequest();
HttpContext.Current.Response.OutputStream.Flush();
那么它不會調用scriptmanager。
Content-Disposition
將提示用戶將內容保存到磁盤。 您在此處呈現頁面的方式看起來不像。 只需將ExportDataString
寫入流。
您期望發生什么事?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.