Solved

Issue with ClientScript.RegisterClientScriptBlock

Posted on 2007-11-21
1
1,652 Views
Last Modified: 2008-02-01
I have an application that I need to call a new window to open up a report.  Here is my full line statement:  ClientScript.RegisterClientScriptBlock(Me.GetType, "newwindow", "<script language=javascript>window.open('" & QueryString & "', 'NewWindow')</script>")

The problem I'm having is the new screen doesn't open up.  It just runs through the code and stays on the same page with opening a new page for the report.  The other thing is that I have the same line of code in another application and it works correctly.  The only difference that I can find is that the application that doesn't work is using a tab control from AJAX.  Could this be my problem?  Thanks for the help.
0
Comment
Question by:aot-johnstown
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 125 total points
ID: 20329151
RegisterClientScriptBlock doesn't execute the Javascript function, it adds the function to the page so that you can call it.  This is usually accomplished by adding an attribute to an HTML element.

Bob
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question