Assuming that the function useTerm
is in you aspx page, you can move that script block within the UpdatePanel
ContentTemplate
.
An alternative would be to change the JavaScript function so term is passed in as a parameter:
function useTerm(term) {
// use term
}
and then to call it with the latest value of Term
:
public void populateTerm()
{
Term = "Test";
string script = string.Format("useTerm('{0}');", Term);
ScriptManager.RegisterStartupScript(this, GetType(), "term", script, true);
}