Click here to Skip to main content
15,890,982 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have some validation callout controls i have three buttons edit, update,cancel

but cancel button is not working whenever any of validation control is invalid

i have already used

function returnTrue()
{
return true;
}

<asp:linkbutton id="cancel" runat="server" onclientclick="return returnTrue(); true;">
Posted
Updated 7-Nov-11 21:51pm
v2

1 solution

Couple of issues with your code.

1) No OnClick Property set.

2) Remove that extra true; in your onclientclick. You are already returning true from your returnTrue() function. Change your code as below.
ASP.NET
<asp:linkbutton id="cancel" runat="server" onclientclick="return returnTrue();" onclick="cancel_Click" >


3) If you noticed above I have assigned cancel_Click event to OnClick, then it should be defined in your code-behind.
C#
void cancel_Click(object sender, System.EventArgs e)
{
  //Your Button Clcik code here.

}
 
Share this answer
 
v2
Comments
pawantiwari52 8-Nov-11 7:51am    
still this is not working
RaisKazi 8-Nov-11 8:40am    
Have a look at below link.
http://forums.asp.net/t/1036404.aspx/1?LinkButton+Post+back+Issues

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900