Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am tring to create like functionality in my project, user can click on image button to like the profile and click again to dislike the profile. Everything working fine but when i click on image button it refresh the whole page. I don't want to refresh whole page so i added update panel but still page is refreshing.
ASP.NET
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                    <tr>
                        <td colspan="5">
                            &nbsp;<asp:ImageButton ID="btn_like" runat="server" ToolTip="Like this Ad" onclick="btn_like_Click1" />                            
                        </td>
                    </tr>
                    </ContentTemplate>
                    </asp:UpdatePanel>
Posted
Updated 4-Jul-14 3:33am
v2

1 solution

Add one AsyncPostBackTrigger.
ASP.NET
<Triggers>
    <asp:AsyncPostBackTrigger ControlID="btn_like" EventName="Click" />
</Triggers>
 
Share this answer
 
Comments
Raj Negi 4-Jul-14 10:27am    
it is still refreshing the page.
Raj Negi 5-Jul-14 15:07pm    
i am doing some mistake. it's working now, thanks

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