简体   繁体   English

如何从C#代码中Response.Flush()之后的代码调用JavaScript函数

[英]How to Call JavaScript Function from code behind after Response.Flush() in C# Code

HttpContext.Current.Response.Flush(); HttpContext.Current.Response.Flush();

ScriptManager.RegisterStartupScript(this, typeof(Page), "Verify", "alert('No Documents Found');", true); ScriptManager.RegisterStartupScript(this,typeof(Page),“ Verify”,“ alert('No Documents Found');”,true);

/* By this way I cant call Javascript Function. / *通过这种方式,我无法调用Javascript函数。 Please be needful */ 请有需要* /

Your script is not registered because Response.Flush or Response.End actually END the response life cycle and send the results of that point back to the client browser. 您的脚本未注册,因为Response.FlushResponse.End实际上结束了响应生命周期并将该点的结果发送回客户端浏览器。

Your RegisterStartupScript has no effect. 您的RegisterStartupScript无效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM