There are several ways to do it, all through the Page.ClientScript property. You can write a script through RegisterClientScriptBlock or RegisterStartupScript, or if you have a script file you can write a reference to that file.
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
as server-side code runs before the client-side code (per request), this is usually achieved so that you generate a js call on the server-side code, and by the time page gets rendered in the browser, the generated script is executed.
The world's simplest example to demonstrate this is to call this on Button's click:
0 joteke 5/29/2007 7:23:57 PM
Thanks for the reply, but doing what you described would only work with a post-back, right?
I'd like to call the function using AJAX functionality, with no post-backs.
In that case, you could register the call with ScriptManager. here's an example
0 joteke 5/29/2007 8:02:43 PM
That will do it! Thanks