Click here to Skip to main content
15,882,552 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How can we make both client click and onclientclick work.
It works when i place asp button outside of updatepanel.
But when the button is in updatepanel only onclientclick is working.
Is there any way to make it possible?
Posted
Updated 29-Mar-11 20:29pm
v2

Use a PostBackTrigger
<asp:ScriptManager ID="scriptManager" runat="server">
        <asp:UpdatePanel ID="updatePanel" runat="server">
            <ContentTemplate>
                <asp:Button ID="btnSubmit" runat="server" OnClientClick="javascript:alert(1);" Text="Click" 
                 onclick="btnSubmit_Click" />
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btnSubmit" />
            </Triggers>
       </asp:UpdatePanel>
 
Share this answer
 
v3
Comments
anushavarma 30-Mar-11 9:44am    
Thank you...It's working
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

rrrrrrrrrrrrrrrrrrrrr
 
Share this answer
 
Comments
Tamimi1429 30-Mar-11 3:20am    
vccc

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