2

I have a button, I need to display a pop-up in javascript. So on its client click I call a javascript function which does that.

if user clicks "yes", I need to do a post back and call buttons server side click event, here is what I am doing inside the javascript function

__doPostBack(deleteLinkButton, 'Click'); 

' Where deleteLinkButton is a variable that has client Id of the button.

Postback happens but it does not go in the click handler for that button.

What can be wrong?

2
  • Ever find a solution to this? I'm running into the same issue. Commented Mar 25, 2011 at 20:35
  • You need to use the name attribute rather than the id attribute of the rendered input tag. Commented Dec 20, 2013 at 12:43

2 Answers 2

1

Try it like this:

__doPostBack('deleteLinkButton', 'Click');
Sign up to request clarification or add additional context in comments.

1 Comment

I am sorry for not explaining this in the question, deleteLinkButton is the variable that has the button client id.
1

Can be done like this:

document.getElementById('<%= Button.ClientID %>').click();

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.