Saturday, November 8, 2008

Javascript on asp.net page

Suppose you want to call some javascript on click of any asp.net button after executing some asp code , you can register javascript and get executed .


string javaScript = " ( script language=' javascript' ) window.close( ) (/script) "; Page.RegisterStartupScript("myScript", javaScript);

This will close the window where this code will be executed.

No comments: