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.
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.
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.
Simple sample of RegisterStartupScript:
RegisterStartupScript("id1", "<script type=\"text/javascript\">alert(\"I'm from JavaScript.\");</script>");
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.