Reputation: 2655
How can I call a javascript function at the end of a vb.net S
Upvotes: 0
Views: 205
Reputation: 5463
If you are trying to do what I think you are, you can use Page.RegisterStartupScript
Dim Script As String = “<script language=javascript” id=’myClientScript’>myFunction();</script>”
Page.RegisterStartupScript(“callTest”,Script)
Upvotes: 0
Reputation: 9193
Check out the RegisterClientScriptBlock Method of the ClientScriptManager class.
Upvotes: 0
Reputation: 67335
If your VB.NET subroutine is running on the server, and you want the JavaScript to run on the client, you can't.
The only way you can come close is by having your VB.NET subroutine construct some appropriate JavaScript in the page being served such that the JavaScript will run when it's loaded.
Upvotes: 2