How To: Open a pop-up window using dropdownlist

To open pop-up window using <asp:dropdownlist..>

VB.NET

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
 Response.Write("<script>window.open('" + DropDownList1.SelectedValue + "');</script>")
End Sub

C#

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Write("<script>window.open('" + DropDownList1.SelectedValue + "');</script>");

To pop-up using client-side event

VB.NET

DropDownListID.Attributes("onchange") = "<open pop up here>"

C#

DropDownListID.Attributes("onchange") = "<open pop up here>";

Published Wednesday, August 02, 2006 12:13 PM by SushilaSB
Filed under:

Comments

Tuesday, June 19, 2007 4:47 PM by Sanjay gupta(sanjay.gupta@laquinta.com

# re: How To: Open a pop-up window using dropdownlist

DropDownListID.Attributes("onchange") = "<open pop up here>";

I want to use this script, but I do not know where to inject this script in ASPX page in ( source/desgin) everywhere I am getting error)

Tuesday, September 02, 2008 4:50 AM by vrunda

# re: How To: Open a pop-up window using dropdownlist

i can open a popup window using above coding.. but wt abt d contain of popup...in popup window thr is an error dat requested url could not be found....tel me plz abt dat.

Tuesday, November 25, 2008 8:22 AM by Mlgrin

# re: How To: Open a pop-up window using dropdownlist

Hi,

my question is how to create a pop up wondow, I will have a link, TAKE A TEST, then a new pop up wondow should open, but not like the one this code does:

<a href="Index.aspx" onclick='window.open("special.aspx?id=1",null,"height=400,width=500,status=yes,toolbar=no,menubar=no,location=no, return=false");' >Take a test</a>

in this code the wondow is derived from the master page. I want something new, any ideas?

I'm using ASP.NET 2.0 and VB

Thanks

Monday, December 08, 2008 12:53 PM by titoglove

# re: How To: Open a pop-up window using dropdownlist

<a href=performancing.com/.../buy-acomplia>Buy Acomplia</a>

Studies also show that it increases levels of HDL (good cholesterol)

while at the same time  reducing the triglycerides (bad cholesterol).

<a href=performancing.com/.../buy-acomplia>Buy Generic Acomplia</a>

Thursday, December 18, 2008 3:43 PM by invoitowelt

# re: How To: Open a pop-up window using dropdownlist

Hello!

<a href=http://pendosam.org/>Buy Accutane</a>

fever, chills, body aches, flu symptoms, purple spots under your skin, easy bruising or bleeding; or

<a href=pendosam.org/>accutane acne after before</a>

Sunday, December 21, 2008 4:56 PM by Axorgorab

# re: How To: Open a pop-up window using dropdownlist

Hello!

<a href=http://pendosam.org/>Buy Accutane</a>

severe diarrhea, rectal bleeding, black, bloody, or tarry stools;

<a href=pendosam.org/>accutane after one month</a>

Leave a Comment

(required) 
(required) 
(optional)
(required)