example of control in ajax alwaysvisible using asp.net
alwaysvisible.aspx
<%@ Page Language="C#" AutoEventWireup="true"
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="AlwaysVisibleControl.aspx.cs"
Inherits="AlwaysVisibleControl"
%>
<%@ Register Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="asp"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:AlwaysVisibleControlExtender ID="AlwaysVisibleControlExtender1"
runat="server"
TargetControlID="Panel1"
VerticalSide="Top" HorizontalSide="Right">
</asp:AlwaysVisibleControlExtender>
<asp:Panel ID="Panel1" runat="server"
Width="147px" Height="62px" BorderWidth="2"
BorderColor="LightPink" BackColor="OrangeRed" HorizontalAlign="Center">
</asp:Panel>
<div>
<table>
<tr>
<td bgcolor="black" height="45px">
<img src="king.jpeg" name="p1" />
<img src="king.jpeg" name="p2" />
<img src="king.jpeg" name="p3" />
<img src="king.jpeg" name="p4" />
<img src="king.jpeg" name="p5" />
</td>
</tr>
</table>
<script language="javascript">
dg0 = new Image(); dg0.src = "dg0.gif";
dg1 = new Image(); dg1.src = "dg1.gif";
dg2 = new Image(); dg2.src = "dg2.gif";
dg3 = new Image(); dg3.src = "dg3.gif";
dg4 = new
Image(); dg4.src = "dg4.gif";
dg5 = new Image(); dg5.src = "dg5.gif";
dg6 = new Image(); dg6.src = "dg6.gif";
dg7 = new Image(); dg7.src = "dg7.gif";
dg8 = new Image(); dg8.src = "dg8.gif";
dg9 = new Image(); dg9.src = "dg9.gif";
dgam = new Image(); dgam.src = "dgam.gif";
dgpm = new Image(); dgpm.src = "dgpm.gif";
dgc = new Image(); dgc.src = "dgc.gif";
function
dotime() {
theTime = setTimeout('dotime()', 1000);
d = new Date();
hr = d.getHours() +
100;
mn = d.getMinutes() +
100;
se = d.getSeconds() +
100;
if (hr == 100) { hr = 112; am_pm = 'am';
}
else if (hr < 112) { am_pm = 'am'; }
else if (hr == 112) { am_pm = 'pm'; }
else if (hr > 112) { am_pm = 'pm'; hr = (hr - 12); }
tot = '' + hr + mn + se;
document.hr1.src = 'dg' + tot.substring(1, 2) + '.gif';
document.hr2.src = 'dg' + tot.substring(2, 3) + '.gif';
document.mn1.src = 'dg' + tot.substring(4, 5) + '.gif';
document.mn2.src = 'dg' + tot.substring(5, 6) + '.gif';
document.se1.src = 'dg' + tot.substring(7, 8) + '.gif';
document.se2.src = 'dg' + tot.substring(8, 9) + '.gif';
document.ampm.src = 'dg' + am_pm + '.gif';
}
dotime();
</script>
</div>
</div>
</form>
</body>
</html>
alwaysvisible.aspx.cs
using System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
public partial class AlwaysVisibleControl : System.Web.UI.Page
{
protected void Page_Load(object
sender, EventArgs e)
{
}
}
0 comments :