Link to home
Start Free TrialLog in
Avatar of ayha1999
ayha1999

asked on

Page Refresh

How can I refresh the loginView control in an asp.net 4.0 web page with an interval of 1min?
please provide a c# sample.

thanks

ayha
Avatar of Rajkumar Gs
Rajkumar Gs
Flag of India image

You mean just refresh the page that contains LoginView control ?
What's the purpose for that ?

Raj
If you want to just refresh the page, put a meta refresh tag (in ASPX page)

<meta http-equiv="refresh" content="60">

Open in new window

for refresh in every 60 seconds

Raj
Avatar of ayha1999
ayha1999

ASKER

Just the loginView control using update panel and timer. not the entire page. In out asp.net intranet application the timeout is half an hour. after that user need to login again. if a page is open for some without refresh, user will not know whether he logged out or not. I wan to avoid it and inform user, his status every min.
ASKER CERTIFIED SOLUTION
Avatar of Rajkumar Gs
Rajkumar Gs
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

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

</head>
<body onload="JavaScript:timedRefresh(5000);">
This page will refresh every 5 seconds. This is because we're using the 'onload' event to call our function. We are passing in the value '5000', which equals 5 seconds.

</body>
</html>
thanks