0

I'm having trouble with this piece of code

e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(GridView1, "Select$" + e.Row.RowIndex);

This is working fine when i click on the row but it's causing me troubles when i click on a button on this row because it start doing the button logic but then it does the click on the row.

I would like to know how to make the row clickable but not when i click on one of the buttons inside of it.

Thanks

1 Answer 1

1

You could try using stopPropagation.

<script type="text/javascript">
    $(document).ready(function () {
        $("table input").click(function (e) {
            e.stopPropagation();
        });
    });
</script>
Sign up to request clarification or add additional context in comments.

1 Comment

Great! it worked.. didn't think at that haha thankyou!

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.