Click here to Skip to main content
15,904,024 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi,
im doing a kind of online shopping project like amazon. when i click a slideshow image button the,whole page has reloads.how to solve this kind of problem.

thanks,
Posted
Updated 13-Nov-13 19:22pm
v3

1 solution

Try this in your code...place you all the control inside the ContentTemplate which are invoking the event and register them into the triger


XML
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button runat="server" ID="update_Button" Text="Generate Random Number" Width="187px"
OnClick="update_Button_Click" />
<pre></ContentTemplate>
</asp:UpdatePanel>
<Triggers>
        <asp:AsyncPostBackTrigger ControlID="update_Button" EventName="Click" />
      
    </Triggers>
 
Share this answer
 
Comments
King Fisher 14-Nov-13 2:14am    
my project looks like this screen page,i have two data list control on the right side like
'TOP EXPERTS IN 24 HRS' and 'TOP EXPERTS IN MONTH'. if i click any one below that,the whole form has reload.so,can i use separate update panel for each data list control . is this a good
[no name] 14-Nov-13 2:21am    
I believe it is best to use multiple UpdatePanel if you can because of the size the POST that the UpdatePanel generates.When you want only a certain part to be postbacked if you want entire page to be postback then it is better to use single update panel.

Make sure that you make the updatemode="conditional" for all the updatepanel otherwise all the updatepanel will get refreshed
King Fisher 14-Nov-13 3:04am    
difference for conditional mode and always mode
[no name] 14-Nov-13 3:09am    
Mode="conditional' causes the updatepanel to update when one of following things happen:

1) If a control within the updatepanel causes the actual postback

2) If a trigger on the updatepanel updates
Otherwise, it won't update and refresh. When it is set to always, however, it will always refresh
King Fisher 14-Nov-13 7:42am    
thanks for your timing

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