0

How to disable/enable dynamically created ImageButton in asp.net using Javascript or Jquery? I am creating a imagebutton and i want to disable it on button click. If anybody understand then please answer my question. Thanks in advance.....

1 Answer 1

1

You can use bellow code for that

  • .aspx

    <asp:ImageButton id="imgButton" runat="server" ImageUrl="~/Images/img1.jpg" /> <asp:Button id="btnClick" runat="server" Text="Click"/>

  • JavaScript

    `

    $(document).ready(function () {
        $('#<%= btnClick.ClientID %>').click(function () {
            $('#<%= imgButton.ClientID %>').attr('disabled', 'disabled'); // Image Button Id which you want to disable.
        });
    });
    

    `

Sign up to request clarification or add additional context in comments.

1 Comment

@Manish Jain Please click upvote or click 'correct' if above answer is useful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.