jquery在asp.net ajax 使用updatepanel提交后失效

zg672313 2010-01-03 08:52:34
如题:
在ajax 使用updatepanel提交数据后,jquery会失效,我当前是在用jquery做了一个图片的预览功能,但是使用ajax 使用updatepanel,重新查询了一次数据后,新查询出来的数据不能使胜Jquery来实现图片的预览功能?

不知各位大侠,怎样解决这样的问题,谢谢.
...全文
389 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaohaxiong 2010-06-12
  • 打赏
  • 举报
回复
LZ怎么解决的啊!!!大家一块学习学习
zg672313 2010-02-23
  • 打赏
  • 举报
回复
谢谢各位的热心帮助,问题已经解决。
_0筱筱0_ 2010-01-05
  • 打赏
  • 举报
回复
晕死居然全部是控件.....这个我还真没怎么用过.....
wxg22526451 2010-01-05
  • 打赏
  • 举报
回复
页面PostBack后在服务端重新注册下JS方法,JS方法内写Jquery的事件等调用
zg672313 2010-01-05
  • 打赏
  • 举报
回复
这是我的页面代码,乞盼高手们有办法能解决掉这个问题:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head runat="server">
<META http-equiv=content-type content="text/html; charset=utf-8" />
<link href="../App_Themes/DefaultThemes/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript" language="javascript" src="../jquery-1.3.min.js"></script>
<script type="text/javascript" language="javascript" src="../tooltip.js"></script>

<style type="text/css">
.x_preview {position:absolute; border:1px solid #ccc; background:#333;padding:5px;display:none;color:#fff;}

</style>

</head>
<body >
<form id="form1" runat="server">
<div align="center">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
</asp:ScriptManager>
<table width="1002" border="0" cellspacing="0" cellpadding="0">
<tr>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="dltProductAdd" runat="server" style="vertical-align:top">
<asp:DataList ID="dltProduct" runat="server" DataSourceID="objProduct"DataKeyField="ProductID">
<HeaderTemplate>
<table width="100%" border="0" cellpadding="3" class="orderright">
<tr>
<td height="30" bgcolor="#C5C8CE" class="top">Name</td>
<td width="80" bgcolor="#C5C8CE" class="top">Price</td>
<td width="190" bgcolor="#C5C8CE" class="top"> </td>
<td width="35" bgcolor="#C5C8CE" class="top"> </td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr onmouseover="this.style.background='#F4F4F4'; " onmouseout="this.style.background=''>
<td width="190">
<img src="../img/name_l.gif" alt=">>" align="absmiddle" />
<asp:LinkButton ID="linkProductCategoryName" runat="server" Text='<%# Eval("ProductName") %>' CommandName="Edit" />
</td>
<td width="80" align="right">
<asp:Label ID="lblPrice"runat="server" ></asp:Label>
</td>
<td width="235" align="right">
 
<a href="../ProductImg/pic02.jpg" class="preview" title="">
<img src="../ProductImg/prev01.jpg" />
</a>
</td>
<td>
<asp:LinkButton ID="btnShortToOrder" runat="server"OnClick="btnShortToOrder_Click">Order</asp:LinkButton>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:DataList>
<asp:ObjectDataSource ID="objProduct" runat="server" SelectMethod="ProductSelectById" >
<SelectParameters>
<asp:ControlParameter ControlID="dltProductCategory" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnUpdateOrder" />
<asp:AsyncPostBackTrigger ControlID="btnCancel" />
<asp:AsyncPostBackTrigger ControlID="gvwOrder" />
</Triggers>
</asp:UpdatePanel>
</tr>
</table>
</div>
</form>
</body>
</html>
antony1029 2010-01-04
  • 打赏
  • 举报
回复
学习。帮顶!!
happyboyxq1985 2010-01-04
  • 打赏
  • 举报
回复
updatepanel好像有时候就会刷新不了东西。
snksilverlight 2010-01-04
  • 打赏
  • 举报
回复
JQUERY 1.3.2里面有.live委托事件的处理可以让效果保持,但是问题是我做了修改后,在UPDATEPANEL里面的LINKBUTTON提交就有问题了。
mngzilin 2010-01-04
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 sp1234 的回复:]
百分百是你javascript编程设计问题,没有别的现成的方法。

其实,在UpdatePanel内部动态显示的东西,它自己应该带着脚本代码。也就是说,你编写脚本代码时,似乎应该根本不假设UpdatePanel中有什么动态的东西出现。
[/Quote].
snksilverlight 2010-01-04
  • 打赏
  • 举报
回复
我也碰到了类似问题,正在研究中...貌似有JQUERY效果的不能套在UPDATEPANEL里面使用。
  • 打赏
  • 举报
回复
百分百是你javascript编程设计问题,没有别的现成的方法。

其实,在UpdatePanel内部动态显示的东西,它自己应该带着脚本代码。也就是说,你编写脚本代码时,似乎应该根本不假设UpdatePanel中有什么动态的东西出现。
njlywy 2010-01-03
  • 打赏
  • 举报
回复
学习下
liuy052 2010-01-03
  • 打赏
  • 举报
回复
没做过,帮顶了。

62,075

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧