本文介绍了Firefox的doPostBack(图像按钮)在IE中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在转发器控件中有图像按钮,用于说说编辑和删除,从中我指示页面的回发并在同一页面上显示结果以进行编辑和删除.该事件在Firefox中工作正常,但在ie中却无法正常工作.该页面根本不发回.我该如何克服这个问题?
我的代码段如下:
I have imagebuttons in repeater control for say edit and delete, from which I m directing a postback of the page and displaying a result on the same page for editing and deleting. The events are working fine in firefox but not in ie. The page is not posting back at all. How can i overcome this problem?
My code snippet is as follows :
<asp:Repeater ID="rprUser" runat="server" onitemcommand="rprUser_ItemCommand">
<ItemTemplate>
<tr>
<td align="left" class="form_text" bgcolor="#FFFFFF" class="text1">
<%#Eval("Name")%>
</td>
<td align="left" class="form_text" bgcolor="#FFFFFF" class="text1">
<%#Eval("Username")%>
</td>
<td align="left" class="form_text" bgcolor="#FFFFFF" class="text1">
<%#Eval("EmailID")%>
</td>
<td align="center" bgcolor="#FFFFFF" class="text1">
<asp:ImageButton ID="btnView" runat="server" Width="25" Height="25" ImageUrl="images/view.jpg" CommandArgument='<%#Eval("UserID")%>' CommandName="View1"></asp:ImageButton>
</td>
<td align="center" bgcolor="#FFFFFF" class="text1">
<asp:ImageButton ID="btnEdit" runat="server" Width="25" Height="25" ImageUrl="images/edt.jpg" CommandArgument='<%#Eval("UserID")%>' CommandName="Edit1"></asp:ImageButton>
</td>
<td align="center" bgcolor="#FFFFFF" class="text1">
<asp:ImageButton ID="btnDelete" runat="server" Width="25" Height="25" ImageUrl="images/delete.jpg" CommandArgument='<%#Eval("UserID")%>' CommandName="Delete1" OnClientClick="javascript:if(confirm('Are you sure you want to Delete the Record ?'))return true; else return false;"></asp:ImageButton>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
谢谢
Anurag
Thanks
Anurag
推荐答案
<asp:ImageButton ID="btnDelete" runat="server" Width="25" Height="25" ImageUrl="images/delete.jpg" CommandArgument='<%#Eval("UserID")%>' CommandName="Delete1" OnClientClick="javascript:if(confirm('Are you sure you want to Delete the Record ?'))return true; else return false;"></asp:ImageButton>
尝试将OnClientClick更改为:
Try changing the OnClientClick to:
OnClientClick="javascript:if(!confirm('Are you sure you want to Delete the Record ?')){return false;}"
这篇关于Firefox的doPostBack(图像按钮)在IE中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!