易截截图软件、单文件、免安装、纯绿色、仅160KB

ajax1.0不支持Response.write里面调用javascript

问题:
    当用户点击删除按钮时,程序调用Response.write("<script>alert('是否继续')</script>")是页面会弹出错误:
Sys.WebForms.PageRequestManagerParserErrorException:The
message received from the server count not be parsed.Common causes for
this error are when the response is modified by calls to
response.Write(),response filters,HttpModules,or server trace is
enabled.
Details:Error parsing near '<script language=javascript'.
原因:
    由于页面中加入了UpdatePanel,而且删除按钮在UpdatePanel里面。
    当用户点击删除按钮时,ajax1.0不支持Response.write里面调用javascript。
解决办法:
    在UpdatePanel的属性中添加PostBackTrigger,ControlID为该删除按钮,如下:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="Button1" />
        </Triggers>
        <ContentTemplate>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
此时我们再单击 Button1 将出现页面闪烁,说明实现了整页回送。PostBackTrigger 只有一个属性:ControlID。


相关文档:

jquery+ajax实现无刷新提交的功能

   <script type="text/javascript" src="jquery-1.3.2.min.js" mce_src="js/jquery.js"></script>  
   <input name="writer" id="writer" type="text" value="" />  
   <input name="pass" id="pass" type="password" value="" />  ......

龙博AJAX框架 基于web的图形控件及可视化设计

http://www.longboo.com/
分页
http://www.longboo.com/Samples/linb/widgets/TreeGrid.Paging/index.html
数据库查询工具
http://www.longboo.com/Samples/comb/OrderManagement/index.html
email工具
http://www.longboo.com/Samples/comb/OutLook/index.html
网店
http://www.longboo.com/Samples/linb/Template ......

隐藏域方式的Ajax实现


xmlHttp形式的Ajax:XmlHttp形式的Ajax IBM技术文档库
以下是利用隐藏iframe实现的ajax:
index.htm
<html>
<head>
</head>
<body>
<iframe id="testFrame" frameborder="0" style="width:0px; height:0px;">
</ifra ......

Ajax 和 XML: 五种常见 Ajax 模式

Asynchronous JavaScript + XML(Ajax)无疑是 2006 年最热门的技术术语,且有望在
2007 得到进一步发展。但是对您的应用程序来说它究竟有什么意义呢?Ajax 应用程序中哪一种常见架构模式应用最广泛呢?本文将介绍五种常见
Ajax 设计模式,可以使用它们作为工作的基础。
的确,Ajax
是 Web 2.0
热门术语,所有人都希望 ......

白话 Ajax 及其入门基础(2)

    四、常见Ajax编程框架
    既然上述Ajax框架已经能工作了,为什么还有那么多的框架呢?
    随着页面的复杂,可能需要书写大量的Javascript脚本来对页面中的DOM对象进行控制,工作量和复杂度会大大增加。Ajax编程框架通常利用面向对象的方法,对一些基本的对象和行为及 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号