just create a brand new class (soz ... I'm a sharper) to hold your
script string.
I actually went to all the effort to create a new project etc etc etc etc
etc to see exactly what you were on about, as maybe I had "found" a question
in your question that was not there and even missed one that was there.
Whatever - I'll stick with the version that tidies up your code. You'll
still have to register the script.
And the script itself doesn't work as its a translation/syntax cock up -
which isn't the question I take it ?
namespace YourNamespace
{
class myTimer
{
myTimer()
{}
getScript()
{
// then put all your strings in here
string sScript;
sScript = "<script language=JavaScript>\n";
sScript += "var(timerID = null);\n";
sScript += "var(timerRunning = False);\n";
sScript += "var(startDate);\n";
sScript += "var(startSecs);\n";
return sScript;
}
}
}
Then ... plonk a label in your aspx
page where you want to
display the
script, say Label1
Yournamespace.MyTimer tm = new Yournamespace.MyTimer();
Label1.Text = tm.GetScript();