Code:
<%@ Import namespace="WebAdmMMI.Utility"%>
<%@ Page language="c#" Codebehind="ControllerIFPage.aspx.cs" AutoEventWireup="false" Inherits="WebAdmMMI.Code.ControllerIF.ControllerIFPage" %>
<%@ Import namespace="System.ComponentModel"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ControllerIFPage</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<LINK rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="JavaScript" type="text/javascript">
function CreateReq()
{
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
try {
xmlhttp = new XMLHttpRequest();
}
catch (e) {
xmlhttp=false;
}
}
if (!xmlhttp && window.createRequest) {
try {
xmlhttp = window.createRequest();
}
catch (e) {
xmlhttp=false;
}
}
return xmlhttp;
}
function fetch(){
var xmlhttp=CreateReq();
alert ("fetch");
xmlhttp.open("GET", "CtrlLoader.aspx?MachinePrefix="+
document.getElementById('LblMachinePrefix').value+
"&RequestTime="+
(new Date()).getTime()+"&method=Refresh",false);//was true
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
document.getElementById('TxtCtrlConsole').value+=xmlhttp.responseText;
document.getElementById('TxtCtrlConsole').scrollTop=document.getElementById('TxtCtrlConsole').scrollHeight;
}
}
xmlhttp.send(null);
}
function Execute() {
var xmlhttp=CreateReq();
xmlhttp.open("GET", "CtrlLoader.aspx?MachinePrefix="+
document.getElementById('LblMachinePrefix').value+
"&RequestTime="+(
new Date()).getTime()+"&method=Execute&CommandStr="+
document.getElementById('TxtCtrlCommandInput').value,false);//was true
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
document.getElementById('TxtCtrlConsole').value+=xmlhttp.responseText;
document.getElementById('TxtCtrlConsole').scrollTop=document.getElementById('TxtCtrlConsole').scrollHeight;
}
}
xmlhttp.send(null);
document.getElementById('TxtCtrlCommandInput').value="";
}
function timed_fetch()
{
alert("timed fetch");
fetch();
setInterval("fetch()",3000);
}
function KillMySession()
{
alert("KillMySession");
var xmlhttp=CreateReq();
xmlhttp.open("GET", "CtrlLoader.aspx?MachinePrefix="+
document.getElementById('LblMachinePrefix').value+
"&RequestTime="+(
new Date()).getTime()+"&method=KillSession",false);//was true
xmlhttp.onreadystatechange=function() {
/*if (xmlhttp.readyState==4) {
document.getElementById('TxtCtrlConsole').value+=xmlhttp.responseText;
document.getElementById('TxtCtrlConsole').scrollTop=document.getElementById('TxtCtrlConsole').scrollHeight;
}*/
}
xmlhttp.send(null);
}
/* function kill_aspbtn()
{
document.getElementById('TxtCtrlConsole').
}*/
</script> <!-- onload="kill_aspbtn();">-->
</HEAD><!--timed_fetch();-->
<body onload="alert('hello');" onunload="KillMySession();">
<form id="Form1" method="post" runat="server">
<P> </P>
<P><asp:label id="LblCtrlPgHeadline" runat="server" Width="100%" Font-Bold="True" Font-Size="Large"></asp:label></P>
<!--<table border="1" width="100%" height="90%">
<tr>
<td>
<asp:TextBox id="TxtCtrlStatus" runat="server" TextMode="MultiLine" Width="100%" Height="100%"></asp:TextBox></td>
<td>-->
<table border="0" width="100%" height="90%">
<TBODY>
<tr>
<td></td>
<td width="90%"><asp:textbox id="TxtCtrlConsole" runat="server" Width="100%" Height="100%" TextMode="MultiLine"></asp:textbox><!--Height="216px"--></td>
<td></td>
</tr>
<tr height="20">
<td></td>
<td width="90%" align="right"><input onclick=fetch(); value='<% GetHeadline("CtrlPgRefresh"); %>' type=button name=Submit>
<asp:button id="BtnRefresh" runat="server" Width="72px" Text="Refresh" Visible="False"></asp:button></td>
<td></td>
</tr>
<tr height="20">
<td></td>
<td width="90%"><asp:textbox id="TxtCtrlCommandInput" runat="server" Width="100%"></asp:textbox></td>
<td></td>
</tr>
<tr height="20">
<td></td>
<td width="90%" align="right"><input onclick=Execute(); value='<% GetHeadline("CtrlPgExecute"); %>' type=button name=Submit2>
<asp:button id="BtnExecuteCtrlCmd" runat="server" Width="64px" Text="Execute" Visible="False"></asp:button></td>
<td>
</td>
</tr>
</TBODY>
</table>
<!--</td>
</tr>
</table>-->
<input type=hidden value="<% GetHidenData(); %>" id="LblMachinePrefix">
<!--<asp:TextBox style="Z-INDEX: 0" id="LblMachinePrefix" runat="server" Visible=False></asp:TextBox>--></form>
</body>
</HTML>