Click here to Skip to main content
15,892,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have an aspx page...My aim is that when I add some new file into a folder then the count should be shown in the webpage and keeps on refreshing whenever a new file is added to the folder....I used ajax and jquery and got the result but I need to know if there are other methods other than ajax jquery and javascript?
Posted

XML
<script type="text/JavaScript">
function timedRefresh(timeoutPeriod)
{
setTimeout("location.reload(true);", timeoutPeriod);
}

</script>


this script set on your file upload button onclick event
 
Share this answer
 
Comments
Member 11596519 10-Apr-15 8:02am    
But this will refresh the whole page right?
I've been having a lot of fun with SignalR lately.

http://signalr.net/[^]

You can perform server sent events!

It hold one connection open per session, no matter how many server "hubs" you create so it's very good unless you expect thousands of visitors to be connected with SignalR
 
Share this answer
 
There are various method to referesh the page in asp.net like...

Java Script
JavaScript
<script type="text/javascript">
  function reloadPage()
  {
    window.location.reload()
  }
</script></script>

Code Behind
C#
Response.Redirect(Request.RawUrl)

Meta Tag
HTML
<meta http-equiv="refresh" content="600"></meta>

Page Redirection
C#
Response.Redirect("~/default.aspx"); // Or whatever your page url
 
Share this answer
 

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