I'm attempting to register some javascript on a Tridion-Generated page via a user control.
I've created a page object that uses a generic aspx page template.
The TBB for the page template contains only the registration for the usercontrol and <!-- TemplateBeginRepeat name="Components" --> @@RenderComponentPresentation()@@ <!-- TemplateEndRepeat -->
.
The Component Presentation contains 1 component that calls a cp that has an associated tbb that calls the usercontrol.
In the usercontrol is the following code:
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["ID"] == "56")
{
ltrClassName.Text = "active";
ClientScriptManager cs = Page.ClientScript;
StringBuilder jscript = new StringBuilder();
jscript.Append("<script type=text/javascript> alert('Hello World!') </");
jscript.Append("script>");
cs.RegisterStartupScript(this.GetType(), "PopupScript", jscript.ToString());
}
else
{
ltrClassName.Text = string.Empty;
}
}
When I view the published page and add ID=56 as a parameter to the url, I get 'active' and nothing else. The jscript is not part of the source.
Any reasons why this will not work with Tridion?