我已禁用链接按钮和图像按钮(位于链接按钮内,以便我可以显示警报)并且在Chrome中工作正常,但是当我在IE8中打开它时图像被禁用但是当我点击它时它显示弹出窗口('您确定要删除此用户吗?')。为什么我在IE8和IE7中出现此错误,我该如何解决这个问题。
<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>
来自观看源的代码:
<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>
答案 0 :(得分:2)
为什么不将ImageButton
目的与LinkButton
合并? (反之亦然......)
<asp:LinkButton runat="server" ID="lBtnDeleteUser" OnClick="lBtnDeleteUser_Click"
OnClientClick='return confirm("Are you sure you want to delete this User?")'
style="display: block; background-image: url('Styles/Images/icon_delete.png');
width: widthOficon_delete.pngInPixels; height: heightOficon_delete.pngInPixels;"
ToolTip="Delete" />
答案 1 :(得分:0)
<asp:ImageButton ID="Img_del" runat="server" Text="Delete" ImageUrl="Styles/Images/icon_delete.png"
AlternateText="Delete" OnClientClick='return confirm("Are you sure you want to delete this item?");' OnClick="imgbtn_UserDeleteClick"/>
我通过在“图像”按钮中使用弹出窗口解决了这个问题[了解了HTML没有禁用链接属性的新内容]