Solved

Open popup when clicking on a button

Posted on 2011-09-20
3
236 Views
Last Modified: 2012-05-12
Hello all!

I need to run this when clicking on an ASP.NET button:

javascript:window.open('mypage.aspx', 'UpdateInfo', 'scrollbars=no,resizable,status,toolbar=no,menubar =no');

I tried with response.write but is not working. How can I run the code above when a button is pressed? thanks!
0
Comment
Question by:pvg1975
3 Comments
 
LVL 16

Assisted Solution

by:Swapnil Piparia
Swapnil Piparia earned 250 total points
ID: 36567488
Hi pvg1975,

       If you are using .net 2.0 or onwards than, set the property "OnClientClick" of ASP.Net button to "javascript:window.open('mypage.aspx', 'UpdateInfo', 'scrollbars=no,resizable,status,toolbar=no,menubar =no');". It will solve your problem.

Thanks,
netswap
0
 
LVL 9

Accepted Solution

by:
jkofte earned 250 total points
ID: 36567530
onClientClick="window.open('mypage.aspx', 'UpdateInfo', 'scrollbars=no,resizable,status,toolbar=no,menubar =no'); return false;" 

Open in new window


(if you add return false, your code will not postback)

0
 

Author Closing Comment

by:pvg1975
ID: 36567552
Thank you both guys, I used part of both solutions so I split the points to be fair :)

Paula
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…

749 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