Solved

Opening popup from ascx page

Posted on 2007-11-20
1
1,951 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…

837 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