Firefox的doPostBack(图像按钮)在IE中不起作用 [英] Firefox doPostBack (Imagebutton) not working in ie

查看:60
本文介绍了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

推荐答案

我找到了解决方案.我错误地在同一个页面上放置了两个表单标签(来自设计师的HTML格式),它们都是[runat ="server"],而这仅是导致上述问题的原因.删除标签对我来说很有效.虽然,我仍然不明白为什么会这样.
I got the solution to it. By mistake I had put two form tags (that came from the designers in fresh HTML) on the same page, both of them were [runat="server"], and that only was causing the issue as stated above. Removing a tag did the job for me. Although, I still don''t understand the concept that why was it happening.


您能否仅检查页面的查看源代码"以了解以下内容?行:
Can you just check the ''View Source'' of the page for what is being rendered for the following line:
<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中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆