Solved

Opening popup from ascx page

Posted on 2007-11-20
1
1,923 Views
Last Modified: 2008-02-05
I need to be able to open a popup window after the user clicks a button on an ascx page. This button needs to get different values from drop down lists and text boxes, create a URL, and open this url on a popup window.

Is there a way to accomplish this?

0
Comment
Question by:jjexpert1
1 Comment
 
LVL 3

Accepted Solution

by:
bcaff86 earned 250 total points
ID: 20321654
You can use the "OnClientClick" property of the button.  Set the value to a javascript window.open call.

It would look something like this in C#.

myButton.OnClientClick = "window.open('" + myDropDown.SelectedValue + myText.Text +"')";

Check here for different ways to format your pop up using window.open:

http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 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

16 Experts available now in Live!

Get 1:1 Help Now