使用微软的Ajax控件遇到的后台js提示语句不起作用的解决方案其一
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<asp:UpdatePanel>
    <ContentTemplate>
                        
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnTeSe" />
    </Triggers>
</asp:UpdatePanel>
原先在使用这两个控件结合做的Ajax效果中遇到数据提交之后提升代码是这样的:
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language='javascript' defer>alert('添加成功');</script>",true);
后来改成这样就可以了:
ScriptManager.RegisterStartupScript(this, this.GetType(), DateTime.Now.ToString(), "alert('添加成功');", true);//这样可以在使用微软Ajax控件的时候可以做后台JS结果弹出效果!
    作者:江宁织造 
博客:http://www.cnblogs.com/wgx0428/
博客:http://www.cnblogs.com/wgx0428/

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号