I have disabled a link button and image button(which is inside a link button so that I can show a Alert) and it works fine in Chrome, but when I open it in IE8 the image is disabled but when i click it it shows the popup('Are you sure you want to delete this User?'). Why am I getting this error in IE8 and IE7, how can I fix this.
<asp:LinkButton ID="lnk_DeleteUser" Enabled="false"
ToolTip="Delete" runat="server"
OnClientClick="return confirm('Are you sure you want to delete this User?')">
<asp:ImageButton ID="Img_del" Enabled="false"
src="Styles/Images/icon_delete.png"
OnClick="imgbtn_UserDeleteClick"
runat="server" Style="border-style: none" alt="Delete User" /></asp:LinkButton>
Code from view source:
<a onclick="return confirm('Are you sure you want to delete this User?');"
id="ctl00_MainContent_UserTable_ctl02_lnk_DeleteUser" title="Delete User"
class="aspNetDisabled"><input type="image" name="ctl00$MainContent$UserTable$ctl02
$Img_del" id="ctl00_MainContent_UserTable_ctl02_Img_del" disabled="disabled"
title="You don't have permission to delete users" class="aspNetDisabled"
src="Styles/Images/icon_delete.png" alt="Delete User" src=""
style="border-style: none" /></a>
I solved it by using pop up in Image button [Learnt a new thing that HTML does not have a disabled attribute for links]
Why not merge the
ImageButton
s purpose with theLinkButton
? (or vice versa...)