user2560521
user2560521

Reputation: 476

why first click on link button doesn't work?

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?

Upvotes: 0

Views: 1377

Answers (2)

MusicLovingIndianGirl
MusicLovingIndianGirl

Reputation: 5947

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.

Upvotes: 0

nphx
nphx

Reputation: 1427

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

Upvotes: 1

Related Questions