• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 611
  • Last Modified:

open popup window in web application in page_load and button click

I received your answer and applied suitable code. but, popup window works for the same application, not for the other. For example, if i use(means create) yahoo.com, when registration, in submit button click code, it should register/insert details into database and after that redirects to "www.google.com".  In this suituation, i want to open "www.google.com" as popup window.
but, if i use the given code sample, it does not popup new window.  Please help me to solve this
2 Solutions
David H.H.LeeCommented:
Hi tamelarasi,
>>...In this suituation, i want to open "www.google.com" as popup window.
There are a lot of alternatives to solve this problem. This is one of the attempt:

void btnClick
   //your existing code...(insert data into database)
   Response.Write("<script type='text/javascript'>window.open('http://www.google.com');</script>");

After inserting into the DB, Add this line to the code

Page.ClientScript.RegisterStartupScript(this.GetType(), "openWin", "OpenWindow();", true);

After that in the Javascript

<script type="javascript">
function  OpenWindow()
window.open ("http://www.google.com","mywindow","location=0,status=0,scrollbars=0,width=500,height=350");

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now