Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET4.0
I am deleting some file using dropdownlist and i want to refresh only dropdownlist without refreshing whole page , so that the files showing in dropdownlist get updated and i get confirmed that file is deleted without refreshing whole page.
Any Idea , How To..?
Posted 16-Feb-13 0:57am
Edited 16-Feb-13 1:45am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Place your content inside Ajax UpdatePanel. And use Ajax timer to refresh the same content for regular interval of time.
 
Ex:
<asp:ScriptManager runat="server" ID="ScriptManager1" />
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
</asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
      </Triggers>
      <ContentTemplate>
            <asp:Label ID="Label1" runat="server"></asp:Label>
</asp:UpdatePanel>
c# code below..
protected void Timer1_Tick(object sender, EventArgs e)
{
     Label1.Text = DateTime.Now.ToShortTimeString().ToString();
}
Above code will fetch current time for regular interval of 1 second. You place your code inside update panel and give time as much you wanted to refresh the content..
  Permalink  
v4

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



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100