Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
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 :

XML
<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>



Thanks
Anurag
Posted

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.
 
Share this answer
 
v2
Can you just check the 'View Source' of the page for what is being rendered for the following line:
XML
<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>


Try changing the OnClientClick to:
XML
OnClientClick="javascript:if(!confirm('Are you sure you want to Delete the Record ?')){return false;}"
 
Share this answer
 
Comments

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900