Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

FREE 12 month online training for ASP.NET & MS Expression Studio and a Free copy of MS Expression Web with Windows Server Purchase
Display Dynamic Current Date And Time in the Title Bar of Web Page

Author: DevASP
Download Source Code : 427_DynamicTitleBarDateTime.zip

This article is about how you can display current date time in the title bar of you IE when your web page is opened.

  • Steps you will do. 
  • Start visual studio and create a new web application. 
  • Drop a label control on the web form and set its following properties. 
Text = “See the title bar of this window”
  
  • Now open the HTML design of you web page and before closing the head tag add the following JavaScript tag and JavaScript function.

<script language="JavaScript">

 

 

 function doTheClock() {

      window.setTimeout( "doTheClock()", 1000 );

      t = new Date();

      if(document.all || document.getElementById){

         document.title = t.toString();

      }

      else{  

         self.status = t.toString();

      }

}      

   doTheClock()

 

</script>

 

 

Now run you web application and see the title of your web page it will show you the current data and time dynamically.

 

 

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Navigating an ASP.Net Page

Disclaimer - Privacy
© 2002-2014 DevASP.net