This is a migrated thread and some comments may be shown as answers.

PostBack not occured in Button OnClientClick

0 Answers 84 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Katte
Top achievements
Rank 1
Katte asked on 05 May 2010, 05:48 AM
Hi,

I have the following code in my page. Postback was not occured eventhough the code "return true" in OnClientClick. 
I have tried the solution given in the following link. But it doesn't works for me.


Kindly give me a solution.

<script type="text/javascript"
     function Validate() { 
         var lblEmp = document.getElementById('<%= lblEmp.ClientID %>'); 
         if (Condition){ 
              lblEmp.style.display = 'block'
              return false; 
         } 
         else{ 
             lblEmp.style.display = 'none'
             return true; 
         } 
    } 
</script> 
    
 


<asp:Button ID="btnSave" runat="server" Width="100px" CssClass="button" 
      Text="Save" OnClick="btnSave_Click" OnClientClick="return Validate();" /> 


Thanks & Regards,
Katte

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Katte
Top achievements
Rank 1
Share this question
or