No I debugged and stepped through all my code and everything was fine. Even when I turn off the IE pop-up blocker it still doesn't work.
Main Topics
Browse All TopicsHi there,
Having problems with getting this.Page.ClientScript.Reg
Not sure what I'm doing wrong with the code.
Nothing seems to happen when the code is executed.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The register Startup script call is in a button click event. Here is some more code:
from ASPX page:
<tr>
<td valign="top">
<asp:UpdatePanel ID="updPurchases" runat="server">
<ContentTemplate>
<asp:PlaceHolder ID="phPurchases" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
from PageLoad Method:
btnLink.Click += new EventHandler(btnLink_Click
from btnLink_Click Method:
//Open up a new window for the pre-recorded seminar
string scriptText = "window.open('" + myURL + "','_blank','height=700,wi
this.Page.ClientScript.Reg
OK, I understand, but you are missing something...
If you make a blank page in VS, copy that code into the page_load, put something in for the myURL variable and run the code it gives a popup window.
It renders on the page thusly:
<script type="text/javascript">
//<![CDATA[
window.open('Default.aspx'
</script>
I'm not trying to make your life difficult. I'm just pointing out that the code given works. That is all I have to work with and so it's all I can report to you. If your code is not too complex and dependent on resources I can't duplicate then post it and Ill take a look.
Otherwise, start turning things off until you find your culprit, something (likely unexpected or unusual) is causing this to fail.
OK so... the plot thickens!
You can register the script block on its own from the page load, no prob. You cannot register it from an async postback of an update panel though. Well you can but the postback ignores it. Using the update panel it is not paying any attention to loading the entire page back, it disregards running the entire page, it only re-runs (if you will) the contents of the updatepanel.
I put together a sample that demonstrates how you can get around this behavior and still be nimble in with your potential needs.
So let's say I have a list of buttons that would open up a different url for each one, I just have to make the function with a parameter and on OnClientClick, I can specify it there right?
I will give this a try, I'm off work in 5 mins, so I won't be able to get to it today. I make the changes in the morning and test it out.
Thanks
Business Accounts
Answer for Membership
by: ddayx10Posted on 2009-06-23 at 14:02:27ID: 24696228
Works perfectly for me on a new blank page in both FF and IE.
You have some other code that is getting in the way, or your popup blocker is on (something like that).