Hi, U can implement this in a simple way using the server RegisterStartUpScript. The example is as follows. In the page_load event u can write this script block. string pagename = "SessionTest.aspx"; String scriptString = "<script language=JavaScript> function
DoClick() {"; scriptString += " window.open('" + pagename + "','Sample','toolbar=no,width=190,height=190,left=500,top=200,status=no,scrollbars=no,resize=no' )}"; scriptString += "<"; scriptString += "/"; scriptString += "script>"; if(!this.IsStartupScriptRegistered("Startup"))
this.RegisterStartupScript("Startup", criptString); then finally in the onload u can call this function as follows. So when the page loads the script is called and the new page opens up as required. Here the pagename variable can be assigned dynamically. This
wud give u the required solution. Any doubts u can get back. Thanks Subasree G
SubasreeG
Member
120 Points
24 Posts
Re: Calling JS function from code behind with parameters
Nov 04, 2003 10:12 AM|LINK