Disabled button with a alert is clickable in IE8 (browser compatibility Issue in Asp.net website)

前端 未结 2 1196
难免孤独
难免孤独 2021-01-27 15:38

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 dis

相关标签:
2条回答
  • 2021-01-27 16:05

    Why not merge the ImageButtons purpose with the LinkButton? (or vice versa...)

    <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" />
    
    0 讨论(0)
  • 2021-01-27 16:15
    <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"/>
    

    I solved it by using pop up in Image button [Learnt a new thing that HTML does not have a disabled attribute for links]

    0 讨论(0)
提交回复
热议问题