RegisterClientScriptBlock woes
Anyone ever have problems with RegisterClientScriptBlock not working? I watch the code being executed in the debugger just as I expect it to, but my JavaScript never gets created--I don't see my alert come up, nor do I see any of the JavaScript code come up when I do a view source in the browser. Any ideas?
Thanks,
cudabean
Code:
override protected void Page_Load(object sender, System.EventArgs e)
{
string strJScript = "<SCRIPT LANGUAGE=javascript>\n";
strJScript += "document.forms.dataForm.scrollPx.value = " + Session["patListContentScrollPos"] + ";";
strJScript += "alert('Attempting to scroll to " + Session["patListContentScrollPos"] + ");";
strJScript += "ListManDataTable.scrollTop = " + Session["patListContentScrollPos"] + ";";
strJScript += "</SCRIPT>";
if (!IsClientScriptBlockRegistered("restoreScrollState"))
{
Page.RegisterClientScriptBlock("restoreScrollState", strJScript);
}
else
{
strJScript = "SOL";
}