Ciao a tutti.
Sto cercando di far funzionare questa pagina di loading, ma con scarso risultato, infatti l'errore è:
Codice PHP:
Errore 1 Il nome 'destURL' non esiste nel contesto corrente.
Potete aiutarmi?
Grazie
codice:
<%@ Page Language="C#" AutoEventWireup="true" %>
<!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>Loading</title>
<script type="text/javascript" language="javascript">
var ctr = 1;
var ctrMax = 50;
var intervalId;
function Begin() {
window.location.href = "<%=destURL %>";
intervalId = window.setInterval("ctr=UpdateIndicator(ctr, ctrMax)", 500);
}
function End() {
window.clearInterval(intervalId);
}
function UpdateIndicator(curCtr, ctrMaxIterations) {
curCtr += 1;
if (curCtr <= ctrMaxIterations) {
document.getElementById("indicator").style.width = curCtr * 10 + "px";
return curCtr;
}
else {
document.getElementById("indicator").style.width = 0;
return 1;
}
}
</script>
<script runat="server">
public partial class loading : System.Web.UI.Page
{
protected string destURL = "";
protected void Page_Load(object sender, System.EventArgs e)
{
if (Request.QueryString["DestPage"] != null)
{
destURL = Request.QueryString["DestPage"].ToString();
foreach (string k in Request.QueryString.AllKeys)
{
if (k != "DestPage")
{
destURL += "&" + k + "=" + Request.QueryString[k].ToString();
}
}
}
else
{
destURL = "http://www.google.it";
}
}
}
</script>
</head>
<body onload="Begin()" onunload="End()">
<form id="form1" runat="server">
<div>
<h3>Loading data please wait</h3>
</div>
<table id="indicator" border="0" cellpadding="0" cellspacing="0" width="0">
<tr><td align="center"></td>
</tr>
</table>
</form>
</body>
</html>