I am using page.registerstartupscript in my code behind C#. Its like this:
string item1=”category1″;
string Script = “window.program = ‘” + item1 + “‘;”;
Page.RegisterStartupScript(“PopupScript”, Script);
item1 gets generated dynamically from some value in code behind. But its not working. Any suggestoins where I m getting wrong?
You need it wrapped in script tags, there’s an overload for this in the newer replacement
ClientScript:Unless you’re on .Net 1.1 I believe,
Page.RegisterStartupScriptis deprecated.