0

I have this linkButton:

<asp:LinkButton runat="server" ID="SaveAllItems" class="saveAll"
                OnClientClick="saveToGroups();return false;"  
                OnClick="saveToAll_Click" 
                Text="Save Items"   />

My first click on this button doesnt work and I dont know why. I tried adding return false; to OnClick but nothing has changed.

saveToGroups- works in js
saveToAll_Click - works in cs

What am I missing here?

2 Answers 2

1

You're returning false to OnClientClick -- it prevents the postback.

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

Comments

0

Remove return false from your OnClientClick event, since it will not post your page back and prevent the button click being fired for the first time.

3 Comments

the OnClientClick - no need postback OnClick - need postback
You can use return false; in your javascript function.
Try using an alert() in your javascript - you can identify whether there's an issue with your function.

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.