2010年12月29日星期三

AJax UpdatePanel Execute Javascript function After PostBack

I want to execute a javascript function on response postback.
I know window.onload=function(){...}, it's init the page,
but I want to reset the page control properties by javascript after the postback, not directly from server.

I  have a btnOK, I add  the following snippet  under btnOK_Click(sender, e);

ScriptManager.RegisterStartupScript(updPanel, GetType(string), "funName", "Alert('hello word!');", True)

It will create a javascript snippet in html on response back. and execute it. on page refresh, it will alert hello word.

没有评论: