views:

1114

answers:

4

I need to open a new window from code-behind on post-back if a specific radio button is selected.

Is there any way to do this?

Thank you.

+1  A: 

You will need to run javascript on postback

Konstantinos
+1  A: 

You can use RegisterStartupScript to send a window.open script to run once the page has loaded.

However, this will cause the majority of popup blockers to get in your way.

Robin Day
A: 

Simple sample of RegisterStartupScript:

RegisterStartupScript("id1", "<script type=\"text/javascript\">alert(\"I'm from JavaScript.\");</script>");
iburlakov
A: 

New windows can be very sketchy, depending on the content that you need to present you might consider using an in window pop-in if you will. You will avoid pop-up blockers that way. If you can give more details we can give better answers.

Bobby Borszich