Friday, 17 May 2013

How to use DataView ToTable method to create a new DataTable in ado.net

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Data" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        DataTable dt = new DataTable();
        dt.TableName = "Books";

        DataColumn dc1 = new DataColumn();
        dc1.ColumnName = "BookID";
        dc1.DataType = typeof(int);
        dc1.AllowDBNull = false;
        dc1.Unique = true;

        DataColumn dc2 = new DataColumn();
        dc2.ColumnName = "Category";
        dc2.DataType = typeof(string);

        DataColumn dc3 = new DataColumn();
        dc3.ColumnName = "BookName";
        dc3.DataType = typeof(string);

        DataColumn dc4 = new DataColumn();
        dc4.ColumnName = "Author";
        dc4.DataType = typeof(string);

        dt.Columns.AddRange(new DataColumn[] { dc1, dc2, dc3, dc4 });

        dt.Rows.Add(new object[] { 1, "iPhone", "iPhone User Interface Cookbook: RAW", "Cameron Banga" });
        dt.Rows.Add(new object[] { 2, "MySQL", "MySQL 5.1 Plugin Development", "Andrew Hutchings, Sergei Golubchik" });
        dt.Rows.Add(new object[] { 3, "MySQL", "MySQL Admin Cookbook", "Daniel Schneller, Udo Schwedt" });
        dt.AcceptChanges();

        Label1.Text = "Source DataTable";
        GridView1.DataSource = dt.DefaultView;
        GridView1.DataBind();

        //this line create a new DataView
        DataView dView = new DataView(dt);
        dView.RowFilter = "Category = 'MySQL'";

        Label2.Text = "Here we create a new DataView<br />" +
                      "and set the RowFilter (Category = 'MySQL')";

        GridView2.DataSource = dView;
        GridView2.DataBind();

        //this line create a new DataTable from DataView
        DataTable dt2 = dView.ToTable();

        Label3.Text = "Here we create a new DataTable from DataView";
        GridView3.DataSource = dt2;
        GridView3.DataBind();
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to use DataView ToTable method to create a new DataTable in ado.net</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:DarkBlue; font-style:italic;">
            How to use DataView ToTable method
            <br /> to create a new DataTable in ado.net
        </h2>
        <hr width="450" align="left" color="CornFlowerBlue" />
        <asp:Label
             ID="Label1"
             runat="server"
             Font-Size="Large"
             ForeColor="DodgerBlue"
             Font-Italic="true"
             >
        </asp:Label>
        <asp:GridView
            ID="GridView1"
            runat="server"
            BorderColor="Snow"
            ForeColor="Snow"
            Width="600"
            Font-Names="Courier"
            >
            <HeaderStyle BackColor="DarkSlateBlue" Height="30" />
            <RowStyle BackColor="MediumVioletRed" />
            <AlternatingRowStyle BackColor="PaleVioletRed" />
        </asp:GridView>
        <br />
        <asp:Label
             ID="Label2"
             runat="server"
             Font-Size="Large"
             ForeColor="DodgerBlue"
             Font-Italic="true"
             >
        </asp:Label>
        <asp:GridView
            ID="GridView2"
            runat="server"
            BorderColor="Snow"
            ForeColor="Snow"
            Width="600"
            Font-Names="Courier"
            >
            <HeaderStyle BackColor="DarkSlateBlue" Height="30" />
            <RowStyle BackColor="MediumVioletRed" />
            <AlternatingRowStyle BackColor="PaleVioletRed" />
        </asp:GridView>
        <br />
        <asp:Label
             ID="Label3"
             runat="server"
             Font-Size="Large"
             ForeColor="DodgerBlue"
             Font-Italic="true"
             >
        </asp:Label>
        <asp:GridView
            ID="GridView3"
            runat="server"
            BorderColor="Snow"
            ForeColor="Snow"
            Width="600"
            Font-Names="Courier"
            >
            <HeaderStyle BackColor="DarkSlateBlue" Height="30" />
            <RowStyle BackColor="MediumVioletRed" />
            <AlternatingRowStyle BackColor="PaleVioletRed" />
        </asp:GridView>
        <asp:Button
            ID="Button1"
            runat="server"
            OnClick="Button1_Click"
            Text="Populate GridView"
            Height="45"
            Font-Bold="true"
            ForeColor="DodgerBlue"
            />
    </div>
    </form>
</body>
</html>


Thursday, 16 May 2013

Information about visitor's browser , visitor browser details


<!--this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
</head>

<body>

<!-- Start of Browser ID JavaScript-->
<!-- This Script allows the visitor to click on the buttons to display their browser's info -->
<!-- Instructions: Just put the beginning of this script between your pages open and closing
head tags and the later part in the body where you want it displayed in your page.  -->
<!-- Script supplied with CoffeeCup HTML Editor -->
<!--             www.coffeecup.com              -->
<head><script>
 <!--
 function CC_getBrowserName()   {  
         document.forms[0].elements[0].value =navigator.appName;    
 }

 function CC_getBrowserVersion()   {  
         document.forms[0].elements[0].value =  navigator.appVersion;    
 }

 function CC_getBrowserCodeName()   {  
         document.forms[0].elements[0].value = navigator.appCodeName;    
 }

 function CC_getBrowserUserAgent()   {  
         document.forms[0].elements[0].value =  navigator.userAgent;    
 }

 function CC_getBrowserNameVersion()   {  
         document.forms[0].elements[0].value = navigator.appName + " " + navigator.appVersion;    
 }

 // -->
 </script>
 </head>
 <center>

<center>
 <form NAME="detect">
 <input TYPE="text" NAME="browser" SIZE="26" MAXLENGTH="40" VALUE="Browser Detection"><br>
 <br><br>Choose a button to reveal your browser's self image.<br>
 <input TYPE="button" VALUE="appName" onClick="CC_getBrowserName()">
 <input TYPE="button" VALUE="appVersion" onClick="CC_getBrowserVersion()">
 <input TYPE="button" VALUE="appCodeName" onClick="CC_getBrowserCodeName()">
 <input TYPE="button" VALUE="userAgent" onClick="CC_getBrowserUserAgent()">
 <input TYPE="button" VALUE="appName / appVersion" onClick="CC_getBrowserNameVersion()"><br><br><br>
 </form>
 </center><p>
<!-- End of Browser ID JavaScript-->

Today's Date in website


<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->
<!-- ONE STEP TO INSTALL MONTHLY:  DAY HIGHLIGHTED:

   1.  Put the code into the BODY of your HTML document  -->
<!-- STEP ONE: Copy this code into the HEAD your HTML document  -->
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body>

<center>
<script LANGUAGE="JavaScript">

<!-- Begin
monthnames = new Array(
"January",
"Februrary",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"Decemeber");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0)
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table border=2 bgcolor=white ");
document.write("bordercolor=black><font color=black>");
document.write("<tr><td colspan=7><center><strong>"
+ monthnames[thismonth] + " " + thisyear
+ "</strong></center></font></td></tr>");
document.write("<tr>");
document.write("<td align=center>Su</td>");
document.write("<td align=center>M</td>");
document.write("<td align=center>Tu</td>");
document.write("<td align=center>W</td>");
document.write("<td align=center>Th</td>");
document.write("<td align=center>F</td>");
document.write("<td align=center>Sa</td>");
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td> </td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td>");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) {
document.write("<a href=\"" + linkdays[c][2] + "\">");
linktrue=true;
      }
   }
}
if (count==thisdate) {
document.write("<font color='FF0000'><strong>");
}
if (count <= monthdays[thismonth]) {
document.write(count);
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</strong></font>");
}
if (linktrue)
document.write("</a>");
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table></p>");
// End -->
</script>
</center>
<!-- Script Size:  2.98 KB  -->

</body>

</html>

<!-- END CODE - Powered javascript code by WWW.webloger.5u.COM &#1591;&#1585;&#1575;&#1581;&#1740; &#1608;&#1576;&#1604;&#1575;&#1711;-->

<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

popup in javascript


<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->
<HTML>
<HEAD>
<!--START OF PopUp on Button Click-->
<!-This script will give you 4 buttons that display pop up windows when clicked. -->
<!-- Instructions:
1.  Copy the coding into the HEAD of your HTML document
2.  Add the last code into the BODY of your HTML document  -->
<!-- Script supplied with CoffeeCup HTML Editor -->
<!--             www.coffeecup.com              -->
<SCRIPT LANGUAGE="JavaScript">
function AlertCC(label, msg)
{
  var cc1 =
    "<TITLE>Window Title</TITLE>" +
    "<BODY BGCOLOR='FFFFFF'><TABLE BORDER=0><TR>" +
        "<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+
        "<FONT SIZE=4 FACE=ARIAL>"
 
  var cc2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><BR><P>"

  var cc3 =  
    "</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+
    "<TD VALIGN=BOTTOM ALIGN=RIGHT>"+
    "<FORM><INPUT TYPE='BUTTON' VALUE='Close Window'" +
                   "onClick='self.close()'>"  +
    "</FORM></TD></TR></TABLE></BODY>"


  popup = window.open("","popDialog","height=280,width=400,scrollbars=no")
  popup.document.write(cc1+cc2+msg+cc3)
  popup.document.close()
}

function ccalert1()
{
  AlertCC('Alert One', 'This script will let you place information about your product or topic of choice.')
}
function ccalert2()
{
  AlertCC('Alert Two', 'This script will let you place information about your product or topic of choice.')
}
function ccalert3()
{
  AlertCC('Alert Three', 'This script will let you place information about your product or topic of choice.')
}
function ccalert4()
{
  AlertCC('Alert Four', 'This script will let you place information about your product or topic of choice.')
}
</SCRIPT>
</HEAD>
<BODY>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="[ Alert One ]" onClick="ccalert1()"></FORM></CENTER><p>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="[ Alert Two ]" onClick="ccalert2()"></FORM></CENTER><p>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="[ Alert Three ]" onClick="ccalert3()"></FORM></CENTER><p>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="[ Alert Four ]" onClick="ccalert4()"></FORM></CENTER><p>
<!-- END OF SCRIPT -->


<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

print button in webpage


<!-- this script got from www.javascriptfreecode.com coded by: Krishna Eydatoula-->

<input type=button name=print value="Print this page" onClick="javascript:window.print()">



<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

no copy, stop copy , stop ctrl C


<!--this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->
<!-- Right Click - Prevent Script
Use this link to help prevent users from stealing your code !-->

<script language="JavaScript">
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Please don't steal my stuff!!!");
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
</script>


disable right click , stop mouse right click, no right click, mouse right click


<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->
</style>
<SCRIPT language=JavaScript>
document.onmousedown=click
var times=0
var times2=10
function click() {
if ((event.button==2) || (event.button==3)) {
if (times>=1) { bye() }
alert("No right clicking!!!!!! don't do it again..");
times++ } }
function bye() {
alert("I said NO right clicking! click ok to exit LMAO!");
bye() }
</SCRIPT>

<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

Music on web ( Mid, Mp3, Wma )


<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->
<embed "1" TYPE="application/x-mplayer2" SRC="http://kkrcity.com/1.mp3" autostart="true" WIDTH="120" HEIGHT="50"></embed></p>


<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

Mouse box,


<!-- this script got from www.javascriptfreecode.com coded by: Krishna Eydatoula-->


<SCRIPT language="JavaScript">
var scroller_msg='W W W . javascriptfreecode . c o m'
var dismissafter=0
var initialvisible=0
if (document.all)
document.write('<marquee id="curscroll" style="position:absolute;width:100px;border:1px dotted silver; font-family:Tahoma;font-size:11px ;background-color:#eaeaea ;visibility:True">'+scroller_msg+'</marquee>')
function followcursor(){
if (initialvisible==0){
curscroll.style.visibility="visible"
initialvisible=1
}
curscroll.style.left=document.body.scrollLeft+event.clientX+10
curscroll.style.top=document.body.scrollTop+event.clientY+10
}
function dismissmessage(){
curscroll.style.visibility="hidden"
}
if (document.all){
document.onmousemove=followcursor
document.ondblclick=dismissmessage
if (dismissafter!=0)
setTimeout("dismissmessage()",dismissafter*1000)
}
</SCRIPT>

<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

continuous marquee , marquee without gap , marquee no gap



<HTML>
<HEAD>
<TITLE>Horizontal Image Scroller 3</TITLE>

<script type="text/javascript">
<!--
// Jeff
// www.huntingground.freeserve.co.uk

// ********** User Defining Area **********

data=[
["ad1.gif","Alt / Title text for image 1","pic01.jpg"],
["logo.gif","Alt / Title text for image 2","pic02.jpg"],
["cooltext424762881.PNG","Alt / Title text for image 3","pic03.jpg"],
["cool.PNG","Alt / Title text for image 4","pic04.jpg"],
["lak.PNG","Alt / Title text for image 5","pic05.jpg"],
["ad1.gif","Alt / Title text for image 6","pic06.jpg"],
["logo.gif","Alt / Title text for image 7","pic07.jpg"],
["cooltext424762881.PNG","Alt / Title text for image 8","pic08.jpg"],
["cool.PNG","Alt / Title text for image 9","pic09.jpg"],
["lak.PNG","Alt / Title text for image 10","pic10.jpg"],
["ad1.gif","Alt / Title text for image 11","pic11.jpg"],
["ad1.gif","Alt / Title text for image 12","pic12.jpg"] // no comma at end of last index
]

imgPlaces=5 // number of images visible
imgWidth=100 // width of the images
imgHeight=100 // height of the images
imgSpacer=4 // space between the images

dir=0 // 0 = left, 1 = right

newWindow=1 // 0 = Open a new window for links 0 = no  1 = yes

// ********** End User Defining Area **********

moz=document.getElementById&&!document.all

step=1
timer=""
speed=50
nextPic=0
initPos=new Array()
nowDivPos=new Array()

function initHIS3(){

for(var i=0;i<imgPlaces+1;i++){ // create image holders
newImg=document.createElement("IMG")
newImg.setAttribute("id","pic_"+i)
newImg.setAttribute("src","")
newImg.style.position="absolute"
newImg.style.width=imgWidth+"px"
newImg.style.height=imgHeight+"px"
newImg.style.border=0
newImg.alt=""
newImg.i=i
newImg.onclick=function(){his3Win(data[this.i][2])}
document.getElementById("display_area").appendChild(newImg)
}

containerEL=document.getElementById("his3container")
displayArea=document.getElementById("display_area")
pic0=document.getElementById("pic_0")

containerBorder=(document.compatMode=="CSS1Compat"?0:parseInt(containerEL.style.borderWidth)*2)
containerWidth=(imgPlaces*imgWidth)+((imgPlaces-1)*imgSpacer)
containerEL.style.width=containerWidth+(!moz?containerBorder:"")+"px"
containerEL.style.height=imgHeight+(!moz?containerBorder:"")+"px"

displayArea.style.width=containerWidth+"px"
displayArea.style.clip="rect(0,"+(containerWidth+"px")+","+(imgHeight+"px")+",0)"
displayArea.onmouseover=function(){stopHIS3()}
displayArea.onmouseout=function(){scrollHIS3()}

imgPos= -pic0.width

for(var i=0;i<imgPlaces+1;i++){
currentImage=document.getElementById("pic_"+i)

if(dir==0){imgPos+=pic0.width+imgSpacer} // if left

initPos[i]=imgPos
if(dir==0){currentImage.style.left=initPos[i]+"px"} // if left

if(dir==1){ // if right
document.getElementById("pic_"+[(imgPlaces-i)]).style.left=initPos[i]+"px"
imgPos+=pic0.width+imgSpacer
}

if(nextPic==data.length){nextPic=0}

currentImage.src=data[nextPic][0]
currentImage.alt=data[nextPic][1]
currentImage.i=nextPic
currentImage.onclick=function(){his3Win(data[this.i][2])}
nextPic++
}

scrollHIS3()
}

timer=""
function scrollHIS3(){
clearTimeout(timer)
for(var i=0;i<imgPlaces+1;i++){
currentImage=document.getElementById("pic_"+i)

nowDivPos[i]=parseInt(currentImage.style.left)

if(dir==0){nowDivPos[i]-=step}
if(dir==1){nowDivPos[i]+=step}

if(dir==0&&nowDivPos[i]<= -(pic0.width+imgSpacer) || dir==1&&nowDivPos[i]>containerWidth){

if(dir==0){currentImage.style.left=containerWidth+imgSpacer+"px"}
if(dir==1){currentImage.style.left= -pic0.width-(imgSpacer*2)+"px"}

if(nextPic>data.length-1){nextPic=0}

currentImage.src=data[nextPic][0]
currentImage.alt=data[nextPic][1]
currentImage.i=nextPic
currentImage.onclick=function(){his3Win(data[this.i][2])}

nextPic++

}
else{
currentImage.style.left=nowDivPos[i]+"px"
}

}
timer=setTimeout("scrollHIS3()",speed)

}

function stopHIS3(){
clearTimeout(timer)
}

function his3Win(loc){
if(loc==""){return}
if(newWindow==0){
location="images/"+loc
}
else{
//window.open(loc)
newin=window.open(loc,'win1','left=430,top=340,width=300,height=300') // use for specific size and positioned window
newin.focus()
}
}

// add onload="initHIS3()" to the opening BODY tag

// -->
</script>

</HEAD>
<BODY onload="initHIS3()">
<h1><span>Horizontal Image Scroller 3</span></h1>
<center>

<DIV id="his3container" style="position:relative; width:0px;height:0px; border:1px solid red;overflow:hidden">

<div id="display_area" style="position:absolute; left:0; top:0; width:0px; height:0px; clip:rect(0,0,0,0)"></div>

</DIV>
</center>
</BODY>
</HTML>


JavaScript Refresh Page


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0061)http://www.quackit.com/javascript/javascript_refresh_page.cfm -->
<HTML
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>JavaScript Refresh Page</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META
content="JavaScript refresh page code, window, auto, codes, reload, url, page, web site, meta, free, java script, auto, automatic refresh, HTML, document"
name=keywords>
<META content="Learn how to reload the page with this JavaScript refresh code."
name=Description><LINK href="/favicon.ico" rel="shortcut icon"><LINK
href="JavaScript Refresh Page_files/quackit.css" rel=stylesheet>
<SCRIPT type=text/javascript>
<!-- hide
function addToFavorites(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
 // Popup window function
 function newWindow(url) {
 popupWindow = window.open(url,'popUpWindow','height=600,width=600,left=50,top=50,resizable=yes,scrollbars=1,toolbar=no,menubar=no,location=no,directories=no,status=no');
}
// end hide -->
</SCRIPT>

<SCRIPT src="JavaScript Refresh Page_files/alternating_tr_colors.js"></SCRIPT>

<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV id=mastHead><A href="http://www.quackit.com/" target=_top><IMG height=52
alt="Quackit Logo" src="JavaScript Refresh Page_files/quackit_logo.gif"
width=210 border=0></A></DIV>
<TABLE id=contentArea cellSpacing=0 cellPadding=0>
  <TBODY>
  <TR>
    <TD id=leftColumn>
      <SCRIPT language=javascript type=text/javascript>
<!-- hide
function jumpToUrl(x){

if (document.siteNavForm.siteNavSelect.value != "null") {
document.location.href = x
}
}

// end hide -->
</SCRIPT>

      <FORM id=siteNavForm name=siteNavForm>
      <DIV class=leftMenuBlock><SELECT id=siteNavSelect
      onchange=jumpToUrl(document.siteNavForm.siteNavSelect.options[document.siteNavForm.siteNavSelect.options.selectedIndex].value)
      name=siteNavSelect> <OPTION>Jump to...</OPTION> <OPTGROUP label=HTML>
          <OPTION value=/create-a-website/>Create a Website</OPTION> <OPTION
          value=/html/>HTML</OPTION> <OPTION value=/myspace/>MySpace</OPTION>
        </OPTGROUP> <OPTGROUP label="CSS &amp; Design"> <OPTION
          value=/css/>CSS</OPTION> <OPTION value=/web_graphics/>Web
          Graphics</OPTION> </OPTGROUP> <OPTGROUP label=Scripting> <OPTION
          value=/javascript/ selected>JavaScript</OPTION> <OPTION
          value=/coldfusion/tutorial/>ColdFusion</OPTION> <OPTION
          value=/php/tutorial/>PHP</OPTION> <OPTION
          value=/vbscript/tutorial/>VBScript</OPTION> </OPTGROUP> <OPTGROUP
        label=Database> <OPTION value=/sql/tutorial/>SQL</OPTION> <OPTION
          value=/sql_server/tutorial/>SQL Server</OPTION> <OPTION
          value=/database/tutorial/>Databases</OPTION> <OPTION
          value=/microsoft_access/tutorial/>Microsoft Access</OPTION> </OPTGROUP>
        <OPTGROUP label="Web Hosting"> <OPTION value=/domain-names/>Domain
          Names</OPTION> <OPTION value=/web_hosting/>Web Hosting</OPTION>
          <OPTION value=/web_servers/tutorial/>Web Servers</OPTION> <OPTION
          value=/how-websites-work/>How Websites Work</OPTION> </OPTGROUP>
        <OPTGROUP label=XML> <OPTION value=/xml/tutorial/>XML</OPTION> <OPTION
          value=/ajax/tutorial/>AJAX</OPTION> </OPTGROUP></SELECT> </DIV></FORM>
      <DIV class=leftMenuBlock><A class=leftMenu
      title="Client side scripting language"
      href="http://www.quackit.com/javascript/">JavaScript Home</A><BR>
      <H4 class=leftMenuHeading><A class=leftMenuHeading title=""
      href="http://www.quackit.com/javascript/tutorial/">JavaScript
      Tutorial</A></H4><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/introduction.cfm">Introduction</A><BR><A
      class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/how_to_enable_javascript.cfm">How
      to Enable JavaScript</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_syntax.cfm">JavaScript
      Syntax</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_popup_boxes.cfm">JavaScript
      Popup Boxes</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_html.cfm">JavaScript
      and HTML</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/external_javascript_file.cfm">External
      JavaScript File</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_operators.cfm">JavaScript
      Operators</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_variables.cfm">JavaScript
      Variables</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_functions.cfm">JavaScript
      Functions</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_events.cfm">JavaScript
      Events</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_if_statements.cfm">JavaScript
      If Statements</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_switch_statement.cfm">JavaScript
      Switch Statements</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_while_loop.cfm">JavaScript
      While Loop</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_for_loop.cfm">JavaScript
      For Loop</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_try_catch.cfm">JavaScript
      Try Catch</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_escape_characters.cfm">JavaScript
      Escape Characters</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_void_0.cfm">JavaScript
      Void(0)</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_cookies.cfm">JavaScript
      Cookies</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_date_and_time.cfm">JavaScript
      Date and Time</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_arrays.cfm">JavaScript
      Arrays</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/two_dimensional_arrays.cfm">Two
      Dimensional Arrays</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/innerhtml_in_javascript.cfm">JavaScript
      innerHTML</A><BR><A class=leftMenu
      href="http://www.quackit.com/javascript/tutorial/javascript_summary.cfm">JavaScript
      Summary</A><BR>
      <H4 class=leftMenuHeading>JavaScript Reference</H4><A class=leftMenu
      title=""
      href="http://www.quackit.com/javascript/javascript_reserved_words.cfm">JavaScript
      Reserved Words</A><BR><A class=leftMenu
      title="Introduction to the 12 JavaScript event handlers"
      href="http://www.quackit.com/javascript/javascript_event_handlers.cfm">JavaScript
      Event Handlers</A><BR><A class=leftMenu
      title="Full listing of all JavaScript methods for dealing with date and time."
      href="http://www.quackit.com/javascript/javascript_date_and_time_functions.cfm">JavaScript
      Date and Time Functions</A><BR>
      <H4 class=leftMenuHeading>JavaScript Examples</H4><A class=leftMenu
      title="" href="http://www.quackit.com/javascript/examples/">List of
      Examples</A><BR><A class=leftMenu title="AKA Jump menu"
      href="http://www.quackit.com/javascript/javascript_dropdown_menu.cfm">JavaScript
      Dropdown Menu</A><BR><A class=leftMenu title="30 second tutorial"
      href="http://www.quackit.com/javascript/javascript_print.cfm">JavaScript
      Print</A><BR><A class=leftMenu title=""
      href="http://www.quackit.com/javascript/javascript_alert_box.cfm">JavaScript
      Alert Box</A><BR><A class=leftMenu title=""
      href="http://www.quackit.com/javascript/codes/javascript_confirm.cfm">JavaScript
      Confirm</A><BR><A class=leftMenu title=""
      href="http://www.quackit.com/javascript/codes/javascript_prompt.cfm">JavaScript
      Prompt</A><BR><A class=leftMenu title=""
      href="http://www.quackit.com/javascript/javascript_status_bar_messages.cfm">JavaScript
      Status Bar Messages</A><BR><A class=leftMenu title=""
      href="http://www.quackit.com/javascript/image_rollovers.cfm">Image
      Rollovers</A><BR><A class=leftMenu
      title="Use JavaScript to create popup windows and popup window function."
      href="http://www.quackit.com/javascript/popup_windows.cfm">Popup
      Windows</A><BR><A class=leftMenu
      title="Learn how to create a URL redirection with this JavaScript redirect code."
      href="http://www.quackit.com/javascript/javascript_redirect.cfm">JavaScript
      Redirect</A><BR><A class=leftMenu
      title="Learn how to create a timed URL redirection with this timed JavaScript redirect code."
      href="http://www.quackit.com/javascript/codes/timed_javascript_redirect.cfm">Timed
      JavaScript Redirect</A><BR><A class=leftMenu
      title="Learn how to reload the page with this JavaScript refresh code."
      href="http://www.quackit.com/javascript/javascript_refresh_page.cfm">JavaScript
      Refresh Page</A><BR></DIV>
      <DIV class=leftMenuBlock>
      <SCRIPT type=text/javascript><!--
google_ad_client = "pub-6331358926293806";
/* Quackit, Left Column, Link Unit, 160x90 */
google_ad_slot = "9059660467";
google_ad_width = 160;
google_ad_height = 90;
//-->
</SCRIPT>

      <SCRIPT src="JavaScript Refresh Page_files/show_ads.js"
      type=text/javascript>
</SCRIPT>
      </DIV>
      <DIV class=rightMenuBlock>
      <DIV class=textAd>
      <H3 class=leftMenuHeading><A class=leftMenu style="FONT-SIZE: 12pt"
      href="http://www.quackit.com/goto/?ref=side_menu&amp;url=http://www.zappyhost.com/">FREE
      Hosting!</A></H3>With every domain name you register with <A
      href="http://www.quackit.com/goto/?ref=side_menu&amp;url=http://www.zappyhost.com/">ZappyHost</A>,
      you get FREE hosting.
      <P>PLUS you get:</P>
      <UL
      style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 10px; PADDING-TOP: 0px">
        <LI>FREE Website Builder
        <LI>FREE Blog
        <LI>FREE Starter Web Page
        <LI>FREE Email Account
        <LI>&amp; much more! (Total value $123 for FREE!)</LI></UL><B><A
      href="http://www.quackit.com/goto/?ref=side_menu&amp;url=http://www.zappyhost.com/">Get
      your FREE hosting today! &gt;&gt;</A></B> </DIV></DIV></TD>
    <TD id=middleColumn>
      <H1>JavaScript Refresh Page</H1>
      <DIV class=printerIcon><A
      href="http://www.quackit.com/javascript/javascript_refresh_page.cfm?pageView=Print"
      target=_blank><IMG height=17 alt="Print Version"
      src="JavaScript Refresh Page_files/printer_icon.gif" width=17 align=middle
      border=0></A></DIV>
      <DIV style="MARGIN: 10px">
      <SCRIPT type=text/javascript><!--
google_ad_client = "pub-6331358926293806";
/* Quackit, Article, Above Body, 336x280, created 27/08/08 */
google_ad_slot = "0342308150";
google_ad_width = 336;
google_ad_height = 280;
//-->
</SCRIPT>

      <SCRIPT src="JavaScript Refresh Page_files/show_ads.js"
      type=text/javascript>
</SCRIPT>
      </DIV>
      <DIV class=relatedLinks><B>Related:</B><BR>•&nbsp;<A
      title="Use the HTML meta tag to refresh your page."
      href="http://www.quackit.com/html/codes/meta_refresh.cfm">Meta
      Refresh</A><BR>•&nbsp;<A title="Redirect to another URL"
      href="http://www.quackit.com/javascript/javascript_redirect.cfm">JavaScript
      Redirect</A><BR></DIV>
      <P>In JavaScript, you refresh the page using
      <CODE>location.reload</CODE>.</P>
      <P>This code can be called automatically upon an event or simply when the
      user clicks on a link.</P>
      <H2>Example JavaScript Refresh code</H2>
      <P>Typing this code:</P><TEXTAREA class=example-code onclick=this.focus();this.select()>&lt;!-- Codes by Quackit.com --&gt;
&lt;a href="javascript:location.reload(true)"&gt;Refresh this page&lt;/a&gt;
</TEXTAREA>
      <P>Results in this:</P>
      <DIV class=example-code><A href="javascript:location.reload(true)">Refresh
      this page</A> </DIV>
      <H2>Auto-Refresh</H2>
      <P>You can also use JavaScript to refresh the page automatically after a
      given time period. Here, we are refreshing the page 5 seconds after the
      page loads. This results in the page continuously refreshing every 5
      seconds.</P>
      <P>This code...</P><TEXTAREA class=example-code onclick=this.focus();this.select()>&lt;!-- Codes by Quackit.com --&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script type="text/JavaScript"&gt;
&lt;!--
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
//   --&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="JavaScript:timedRefresh(5000);"&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;But hey, try not to annoy your users too much with unnecessary page refreshes every few seconds!&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</TEXTAREA>
      <DIV class=example-code>
      <P><A
      href="http://www.quackit.com/javascript/javascript_refresh_page_example_1.cfm"
      target=_blank>View the result</A> (opens in new window)</P></DIV>
      <DIV class=tip>
      <P>You can achieve the same effect using the <A
      href="http://www.quackit.com/html/codes/meta_refresh.cfm">HTML meta
      tag</A>.</P></DIV>
      <H2>Other Refresh Tricks</H2>
      <P>By including your refresh code in a function, you can have complete
      control over when the page is refreshed.</P>
      <H3>Example 1</H3>
      <P>Instead of having the "page refresh" function called automatically when
      the page loads, you can call it only when the user performs some action -
      such as clicking on a link.</P>
      <P>This code...</P><TEXTAREA class=example-code onclick=this.focus();this.select()>&lt;!-- Codes by Quackit.com --&gt;
&lt;script type="text/JavaScript"&gt;
&lt;!--
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
//   --&gt;
&lt;/script&gt;
&lt;p&gt;
&lt;a href="javascript:timedRefresh(2000)"&gt;Refresh this page in 2 seconds&lt;/a&gt; |
&lt;a href="javascript:timedRefresh(5000)"&gt;Refresh this page in 5 seconds&lt;/a&gt;
&lt;/p&gt;
&lt;/div&gt;
</TEXTAREA>
      <P>Results in this:</P>
      <DIV class=example-code>
      <SCRIPT type=text/JavaScript>
<!--
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
//   -->
</SCRIPT>

      <P><A href="javascript:timedRefresh(2000)">Refresh this page in 2
      seconds</A> | <A href="javascript:timedRefresh(5000)">Refresh this page in
      5 seconds</A> </P></DIV>
      <H3>Example 2</H3>
      <P>You can use <A
      href="http://www.quackit.com/javascript/tutorial/javascript_if_statements.cfm">conditional
      statements</A> to determine whether or not to refresh the page. Here's a
      basic example of using a "confirm" box to ask the user if it's OK to
      refresh the page.</P><TEXTAREA class=example-code onclick=this.focus();this.select()>&lt;script language="javascript" type="text/javascript" &gt;
&lt;!--
function confirmRefresh() {
var okToRefresh = confirm("Do you really want to refresh the page?");
if (okToRefresh)
{
setTimeout("location.reload(true);",1500);
}
}
// --&gt;
&lt;/script&gt;
&lt;p&gt;&lt;a href="javascript:confirmRefresh();"&gt;Refresh Page&lt;/a&gt;&lt;/p&gt;
</TEXTAREA>
      <P>Results in this:</P>
      <DIV class=example-code>
      <SCRIPT language=javascript type=text/javascript>
<!--
function confirmRefresh() {
var okToRefresh = confirm("Do you really want to refresh the page?");
if (okToRefresh)
{
setTimeout("location.reload(true);",1500);
}
}
// -->
</SCRIPT>

      <P><A href="javascript:confirmRefresh();">Refresh Page</A></P></DIV>
      <P>By incorporating refresh code with a JavaScript function, you can
      trigger a refresh at any time that makes sense to your web
application.</P>
      <H2>HTML Refresh</H2>
      <P>The above examples will only work as long as the user has JavaScript
      enabled on their browser. You can also <A
      href="http://www.quackit.com/html/codes/meta_refresh.cfm">use HTML to
      refresh a page</A> automatically once the page has loaded. This is
      achieved by using the HTML meta tag.</P>
      <DIV style="CLEAR: right; MARGIN: 10px">
      <DIV style="CLEAR: right; MARGIN: 10px">
      <SCRIPT type=text/javascript><!--
google_ad_client = "pub-6331358926293806";
/* Quackit, Below Body, 336x280, created 27/08/08 */
google_ad_slot = "0188061149";
google_ad_width = 336;
google_ad_height = 280;
//-->
</SCRIPT>

      <SCRIPT src="JavaScript Refresh Page_files/show_ads.js"
      type=text/javascript>
</SCRIPT>
      </DIV></DIV>
      <DIV
      style="BORDER-TOP-WIDTH: 5px; PADDING-RIGHT: 5px; PADDING-LEFT: 5px; BORDER-LEFT-WIDTH: 5px; BORDER-BOTTOM-WIDTH: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; BACKGROUND-COLOR: #efefef; BORDER-RIGHT-WIDTH: 5px">
      <DIV>
      <H2>Enjoy this website?</H2>
      <OL style="TEXT-ALIGN: left">
        <LI>Link to this page (copy/paste into your own website or blog):
        <FORM action=""><TEXTAREA style="OVERFLOW: hidden" onclick=this.focus();this.select() rows=4 cols=40>&lt;a href="http://www.quackit.com/javascript/javascript_refresh_page.cfm"&gt;JavaScript Refresh Page&lt;/a&gt; from Quackit.com</TEXTAREA>
        </FORM>
        <LI>Add this page to your favorite social bookmarks sites:<BR><A
        title=Digg onfocus="sociable_description_link(this, 'bodytext')"
        href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww%2Equackit%2Ecom%2Fjavascript%2Fjavascript%5Frefresh%5Fpage%2Ecfm&amp;title=JavaScript%20Refresh%20Page"><IMG
        class=social-bookmarks title=Digg alt=Digg
        src="JavaScript Refresh Page_files/digg.png" border=0></A>&nbsp; <A
        title=del.icio.us
        href="http://del.icio.us/post?url=http%3A%2F%2Fwww%2Equackit%2Ecom%2Fjavascript%2Fjavascript%5Frefresh%5Fpage%2Ecfm&amp;title=JavaScript%20Refresh%20Page"><IMG
        class=social-bookmarks title=del.icio.us alt=del.icio.us
        src="JavaScript Refresh Page_files/delicious.png" border=0></A>&nbsp; <A
        title=Reddit
        href="http://reddit.com/submit?url=http%3A%2F%2Fwww%2Equackit%2Ecom%2Fjavascript%2Fjavascript%5Frefresh%5Fpage%2Ecfm&amp;title=JavaScript%20Refresh%20Page"><IMG
        class=social-bookmarks title=Reddit alt=Reddit
        src="JavaScript Refresh Page_files/reddit.png" border=0></A>&nbsp; <A
        title=YahooMyWeb
        href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww%2Equackit%2Ecom%2Fjavascript%2Fjavascript%5Frefresh%5Fpage%2Ecfm&amp;t=JavaScript%20Refresh%20Page"><IMG
        class=social-bookmarks title=YahooMyWeb alt=YahooMyWeb
        src="JavaScript Refresh Page_files/yahoomyweb.png" border=0></A>&nbsp;
        <A title=Netvouz
        href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww%2Equackit%2Ecom%2Fjavascript%2Fjavascript%5Frefresh%5Fpage%2Ecfm&amp;title=JavaScript%20Refresh%20Page&amp;popup=no"><IMG
        class=social-bookmarks title=Netvouz alt=Netvouz
        src="JavaScript Refresh Page_files/netvouz.png" border=0></A>&nbsp; <A
        title=Slashdot
        href="http://slashdot.org/bookmark.pl?title=JavaScript%20Refresh%20Page&amp;url=http%3A%2F%2Fwww%2Equackit%2Ecom%2Fjavascript%2Fjavascript%5Frefresh%5Fpage%2Ecfm"><IMG
        class=social-bookmarks title=Slashdot alt=Slashdot
        src="JavaScript Refresh Page_files/slashdot.png" border=0></A>&nbsp;
        <LI>Add this page to your <A
        href="javascript:addToFavorites(document.title,%20location.href)">Favorites</A>
        </LI></OL>
      <P>Oh, and thank you for supporting Quackit!</P></DIV></DIV></TD><!-- END BODY -->
    <TD id=rightColumn><!-- START SIDE AD --><!-- SiteSearch Google -->
      <DIV class=rightMenuBlock>
      <FORM id=cse-search-box action=http://www.quackit.com/search/>
      <DIV><INPUT type=hidden value=partner-pub-6331358926293806:twzi78ljbw5
      name=cx> <INPUT type=hidden value=FORID:10 name=cof> <INPUT type=hidden
      value=ISO-8859-1 name=ie> <INPUT size=22 name=q> <INPUT type=submit value=Search name=sa> </DIV></FORM>
      <SCRIPT src="JavaScript Refresh Page_files/brand.htm"
      type=text/javascript></SCRIPT>
      </DIV><!-- SiteSearch Google -->
      <DIV class=rightMenuBlock>
      <SCRIPT type=text/javascript><!--
google_ad_client = "pub-6331358926293806";
/* Quackit, Right Column SkyScraper, 160x600 */
google_ad_slot = "6652455774";
google_ad_width = 160;
google_ad_height = 600;
//-->
</SCRIPT>

      <SCRIPT src="JavaScript Refresh Page_files/show_ads.js"
      type=text/javascript>
</SCRIPT>
      </DIV>
      <DIV class=rightMenuBlock>
      <DIV class=rightMenuLink
      style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px">
      <H3 class=leftMenuHeading><A class=leftMenu style="FONT-SIZE: 12pt"
      href="http://www.quackit.com/html/templates/">Free Templates</A></H3><A
      href="http://www.quackit.com/html/templates/"><IMG height=119
      alt="Sample website template"
      src="JavaScript Refresh Page_files/template_40.jpg" width=145
      border=0></A>
      <DIV style="WIDTH: 145px; FONT-STYLE: italic; TEXT-ALIGN: right"><A
      class=leftMenu href="http://www.quackit.com/html/templates/">More
      Templates...</A></DIV></DIV></DIV>
      <DIV class=leftMenuBlock>
      <DIV class=rightMenuLink
      style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px">
      <DIV class=textAd>
      <H3 class=leftMenuHeading><A class=leftMenu style="FONT-SIZE: 12pt"
      href="http://www.quackit.com/goto/?ref=side_menu&amp;url=http://idickson.cscott5288.hop.clickbank.net/?tid=SiteAd"
      rel=nofollow>Need Content for your Website?</A></H3>Get unique, quality
      digital content for your website. You can even earn money by reselling it!

      <P>Includes:</P>
      <UL
      style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 10px; PADDING-TOP: 0px">
        <LI>Over 29,000 Ebooks
        <LI>Over 7,000 Website templates
        <LI>Over 11,000 Fonts
        <LI>Over 39,000 Logos
        <LI>Over 1,000 Cell Phone Games
        <LI>Over 3,000 Cell Phone Images
        <LI>Over 21,000 Ring Tones
        <LI>...and much more! </LI></UL><B><A
      href="http://www.quackit.com/goto/?ref=side_menu&amp;url=http://idickson.cscott5288.hop.clickbank.net/?tid=SiteAd"
      rel=nofollow>Get your 10GB webmaster package now!</A></B> </DIV></DIV><!-- END SIDE AD --></DIV></TD></TR></TBODY></TABLE><!-- START FOOTER -->
<DIV id=footer>
<P><A href="http://www.quackit.com/coldfusion">ColdFusion</A> | <A
href="http://www.quackit.com/create-a-website">Create a Website</A> | <A
href="http://www.quackit.com/css">CSS</A> | <A
href="http://www.quackit.com/html">HTML</A> | <A
href="http://www.quackit.com/javascript">JavaScript</A> | <A
href="http://www.quackit.com/database/tutorial">Databases</A> | <A
href="http://www.quackit.com/domain-names/">Domain Names</A> | <A
href="http://www.quackit.com/microsoft_access/tutorial/">Microsoft Access</A> |
<A href="http://www.quackit.com/myspace/codes/">MySpace Codes</A> | <A
href="http://www.quackit.com/php">PHP</A> | <A
href="http://www.quackit.com/sql">SQL</A> | <A
href="http://www.quackit.com/sql_server/tutorial/">SQL Server</A> | <A
href="http://www.quackit.com/vbscript">VBScript</A> | <A
href="http://www.quackit.com/web_design">Web Design</A> | <A
href="http://www.quackit.com/web_graphics/">Web Graphics</A> | <A
href="http://www.quackit.com/web_hosting/">Web Hosting</A> | <A
href="http://www.quackit.com/web_servers/tutorial/">Web Servers</A> | <A
href="http://www.quackit.com/xml/tutorial/">XML</A></P>
<P><A href="http://www.quackit.com/about.cfm">About Quackit</A> | <A
href="http://www.quackit.com/terms_of_use.cfm">Terms of use</A> | <A
href="http://www.quackit.com/privacy_policy.cfm">Privacy Policy</A> | <A
href="http://www.quackit.com/contact.cfm">Contact Quackit</A></P>
<P>© Copyright 2000 - 2009 Quackit.com &nbsp;</P></DIV>
<SCRIPT src="JavaScript Refresh Page_files/urchin.js" type=text/javascript>
</SCRIPT>

<SCRIPT type=text/javascript>
_uacct = "UA-269964-1";
urchinTracker();
</SCRIPT>
<!-- END FOOTER --></BODY></HTML>

disable browser back button


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type = "text/javascript" >
function disableBackButton()
{
window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>
</head>
<body onload="disableBackButton()">
<form id="form1" runat="server">
<div>
This is First page <br />
<br />
Go to Second page
<br />
<br />
<asp:LinkButton ID="LinkButton1" runat="server"
PostBackUrl="~/Default2.aspx">Go to Second Page
</asp:LinkButton></div>
</form>
</body>
</html>


-------------------------------------------

OR

-------------------------------------------

<script language="JavaScript1.2">

if (document.all){
document.onkeydown = function (){
var key_f5 = 116; // 116 = F5

if (key_f5==event.keyCode){
event.keyCode = 27;

return false;
}
}
}

</script>

Date and time following mouse


<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->
<!--END CODE - Powered java script code by <span lang="en-us"><font color="#FFFFFF"><b>
<font size="5" color="#FFFFFF">
<a href="http://www.javakhafan.9f.com.com">http://www.javakhafan.9f.com.com</a></font></b></font></span>-->

<SCRIPT language=JavaScript>



dCol='cc0099';//date colour.



fCol='ff99cc';//face colour.



sCol='cc99ff';//seconds colour.



mCol='008000';//minutes colour.



hCol='000080';//hours colour.



ClockHeight=40;



ClockWidth=40;



ClockFromMouseY=0;



ClockFromMouseX=100;







//Alter nothing below! Alignments will be lost!







d=new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");



m=new Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER");



date=new Date();



day=date.getDate();



year=date.getYear();



if (year < 2000) year=year+1900;



TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;



D=TodaysDate.split('');



H='ooo';



H=H.split('');



M='oooo';



M=M.split('');



S='.....';



S=S.split('');



Face='1 2 3 4 5 6 7 8 9 10 11 12';



font='tohoma';



size=1;



speed=0.6;



ns=(document.layers);



ie=(document.all);



Face=Face.split(' ');



n=Face.length;



a=size*10;



ymouse=0;



xmouse=0;



scrll=0;



props="<font face="+font+" size="+size+" color="+fCol+"><B>";



props2="<font face="+font+" size="+size+" color="+dCol+"><B>";



Split=360/n;



Dsplit=360/D.length;



HandHeight=ClockHeight/4.5



HandWidth=ClockWidth/4.5



HandY=-7;



HandX=-2.5;



scrll=0;



step=0.06;



currStep=0;



y=new Array();x=new Array();Y=new Array();X=new Array();



for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}



Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();



for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}



if (ns){



for (i=0; i < D.length; i++)



document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');



for (i=0; i < n; i++)



document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');



for (i=0; i < S.length; i++)



document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');



for (i=0; i < M.length; i++)



document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');



for (i=0; i < H.length; i++)



document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');



}



if (ie){



document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');



for (i=0; i < D.length; i++)



document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');



document.write('</div></div>');



document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');



for (i=0; i < n; i++)



document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>');



document.write('</div></div>');



document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');



for (i=0; i < H.length; i++)



document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');



document.write('</div></div>');



document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');



for (i=0; i < M.length; i++)



document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');



document.write('</div></div>')



document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');



for (i=0; i < S.length; i++)



document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');



document.write('</div></div>')



}



(ns)?window.captureEvents(Event.MOUSEMOVE):0;



function Mouse(evnt){



ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;



xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;



}



(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;



function ClockAndAssign(){



time = new Date ();



secs = time.getSeconds();



sec = -1.57 + Math.PI * secs/30;



mins = time.getMinutes();



min = -1.57 + Math.PI * mins/30;



hr = time.getHours();



hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;



if (ie){



Od.style.top=window.document.body.scrollTop;



Of.style.top=window.document.body.scrollTop;



Oh.style.top=window.document.body.scrollTop;



Om.style.top=window.document.body.scrollTop;



Os.style.top=window.document.body.scrollTop;



}



for (i=0; i < n; i++){



 var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;



 F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;



 F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);



 }



for (i=0; i < H.length; i++){



 var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;



 HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;



 HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);



 }



for (i=0; i < M.length; i++){



 var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;



 ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;



 ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);



 }



for (i=0; i < S.length; i++){



 var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;



 SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;



 SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);



 }



for (i=0; i < D.length; i++){



 var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;



 DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;



 DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);



 }



currStep-=step;



}



function Delay(){



scrll=(ns)?window.pageYOffset:0;



Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);



Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);



for (i=1; i < D.length; i++){



Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);



Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);



}



y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);



x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);



for (i=1; i < n; i++){



y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);



x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);



}



ClockAndAssign();



setTimeout('Delay()',20);



}



if (ns||ie)window.onload=Delay;



                      </SCRIPT>
<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

Clock In Website


<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->

<SCRIPT

LANGUAGE="JavaScript">

var timerID = null;
var timerRunning = false;

function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}

function showtime ()
{
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()

var timeValue = "" + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
document.clock.face.value = timeValue;

// you could replace the above with this
// and have a clock on the status bar:
// window.status = timeValue;

timerID = setTimeout("showtime()",1000);
timerRunning = true;
}

function startclock ()
{
// Make sure the clock is stopped
stopclock();
showtime();
}

</SCRIPT>

<BODY onLoad="startclock(); timerONE=window.setTimeout"

TEXT="ffffff">

<CENTER><form name="clock" onSubmit="0">
<input type="text" name="face" size=13 value=""></CENTER>



<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

Change the mouse cursor shape style


<!-- this script got from www.javascriptfreecode.com coded by: Krishna Eydatoula-->

<style>body{cursor:url("Choose your mouse cursor");}</style>

<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

Change status bar moving mouse on picture


<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->

<!-- This displays 'Your Message Here' in the status bar when the mouse -->
<!--    pointer is over the 'Put Image Here' image -->

<CENTER>
<A HREF="URL"  onMouseOver="window.status='Your Message Here'; return true"
onMouseOut="window.status=''">
<P><IMG SRC="Put Image Here"></A>
</CENTER>

<!-- This displays 'Your Message Here' in the status bar when the mouse -->
<!--    pointer is over the 'Put Image Here' image -->

<CENTER>
<A HREF="URL"  onMouseOver="window.status='Your Message Here'; return true"
onMouseOut="window.status=''">
<P><IMG SRC="Put Image Here"></A>
</CENTER>


<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

Automatically maximize window


<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula -->

<!-- START OF Window Auto Maximize DHTML -->


<!-- SUMMARY BRIEF

This code will automatically maximize the
browser window when the page is loaded.

-->


<!-- Put this code inside of your <HEAD> tag. -->


<script language="JavaScript1.2">
<!--

top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}

//-->
</script>


<!-- END OF Window Auto Maximize DHTML -->
<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

ASp.Net Menu with css


<%@ Page Language="C#" %>
<!DOCTYPE 
html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >
<head id=
"Head1" runat="server">
    <style type="text/css">
        .staticMenuItem
        {
            color:black;
            border:solid 1px black;
            padding:2px 4px;
        }
        .menuHover
        {
            color:white;
            background-color:blue;
        }
        .dynamicMenuItem
        {
            color:black;
            padding:2px 4px;       
        }
        .dynamicMenu
        {
            border:Solid 1px black;
            filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=5, OffY=5, Color='gray', Positive='true')" 
        }
    </style>
    <title>Menu Desktop</title>
</head>
<
body>
    <form id="form1" runat="server">
    <div>
    
    <asp:Menu
        id="Menu1"
        Orientation="Horizontal"
        StaticMenuItemStyle-CssClass="staticMenuItem"
        StaticHoverStyle-CssClass="menuHover"
        DynamicHoverStyle-CssClass="menuHover"
        DynamicMenuItemStyle-CssClass="dynamicMenuItem"
        DynamicMenuStyle-CssClass="dynamicMenu"
        Runat="server">
        <Items>
        <asp:MenuItem 
            Text="File"
            Selectable="false">
            <asp:MenuItem 
                Text="Save" />
            <asp:MenuItem 
                Text="Open" />
        </asp:MenuItem>    
        <asp:MenuItem 
            Text="Format"
            Selectable="false">
            <asp:MenuItem 
                Text="Bold" 
                ImageUrl="MenuImages/Bold.gif" />
            <asp:MenuItem 
                Text="Italic" 
                ImageUrl="MenuImages/Italic.gif" />
            <asp:MenuItem 
                Text="Underline"
                ImageUrl="MenuImages/Underline.gif"
                SeparatorImageUrl="Images/Divider.gif" />
            <asp:MenuItem
                Text="Left Align" 
                ImageUrl="MenuImages/JustifyLeft.gif" />
            <asp:MenuItem
                Text="Center Align" 
                ImageUrl="MenuImages/JustifyCenter.gif" />            
            <asp:MenuItem
                Text="Right Align"
                ImageUrl="MenuImages/JustifyRight.gif" />                
        </asp:MenuItem>    
        </Items>
    </asp:Menu>    
    
    </div>
    </form>
</
body>
</
html>