Bunch's Blog

One day I'll have a catchy subtitle, one day
posts - 77, comments - 89, trackbacks - 0

My Links

News

Tag Cloud

Archives

Green

JavaScript: Hurdling the ScriptManager

This piece of code is related to a previous post of JavaScript Window from Code Behind. The idea is the same; I needed to get some JavaScript to run from the code behind. For this example it was to open a new window. The real difference with this and the previous post is using  ScriptManager instead of ClientScript.

 

VB.Net Code

Dim strScript As String = "<script language='javascript'>"

strScript += "window.open('URL Goes Here');"

strScript += "</script>"

ScriptManager.RegisterStartupScript(Page, Me.GetType, "clientScript", strScript, False)

C#

string script = "<script language='javascript'>";
script += "window.open('URL Goes Here');";
script += "</script>";
ScriptManager.RegisterStartupScript(Page, typeof(string), "clientScript", script, false);

 

Technorati Tags: ,,

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Friday, June 20, 2008 9:54 AM |

Feedback

Gravatar

# re: JavaScript: Hurdling the ScriptManager

string script = "<script language='javascript'>";
script += "window.open('URL Goes Here');";
script += "</script>";
ScriptManager.RegisterStartupScript(Page, typeof(string), "clientScript", script, false);

It is working for Mozilla Firefox Browser but not working for IE.

Please help me
7/6/2009 6:48 PM | Hema
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: