开发者

Script manager not calling with HttpContext

开发者 https://www.devze.com 2023-04-02 18:11 出处:网络
When i use ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), \"TTTT111\", \"alert(\'calling dfdfd from server .....\');\", true);

When i use

ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "TTTT111", "alert('calling dfdfd from server .....');", true);

before or after

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.OutputS开发者_如何学Pythontream.Flush();

then it does not call scriptmanager.


The Content-Disposition will prompt the user to save the content to disk. It doesn't look like you are rendering the page here. Just writing ExportDataString to the stream.

What is it you are expecting to happen?

0

精彩评论

暂无评论...
验证码 换一张
取 消