Solved

Open popup when clicking on a button

Posted on 2011-09-20
3
233 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now