Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Open popup when clicking on a button

Posted on 2011-09-20
3
Medium Priority
?
241 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 1000 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 1000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Loops Section Overview
Suggested Courses

916 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