0

I have an external compiled project(asp.net) that we are using in our code. I dont have access to the code behind, just the .aspx pages.

One of the things Im trying to do is to call two functions from the button in the page.

<cc1:ImageButton ID="btnYes" runat="server" OnClick="btnYes_Click" Text="Yes"
                        Width="40px" SkinID="DefaultButton" />

Is there a way I can add a JS function and let the OnClick event call both btnYes_Click and my JS function? something like this? OnClick="btnYes_Click ; myfunction();"

I dont have any access to the code behind page.

1 Answer 1

2

Yes there is an event called OnClientClick="JSFunction" add that to your control. if not then add it from codebehind like MyControl.Attributes["onclick"] = "JSFunction";

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

Comments

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.