I am trying to RegisterClientScriptBlock in a method that is only called via an AJAX call. It doesn't appear to actually register the script on the page and I'm guessing this is because it's not actually reloading the entire page. Is there any way to register javascript on a page from within an ajax method call?
protected void MyMethod(object sender, EventArgs e)
{
// This method only called via AJAX call
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "resize", "alert('here');", true);
}
See Question&Answers more detail:os