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 2, 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 2, 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

Sunday, December 13, 2009 9:52 PM by cash advance

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

Hello!!! weblogs.asp.net is one of the most outstanding resourceful websites of its kind. I take advantage of reading it every day. Keep it that way.

Tuesday, October 23, 2012 6:02 PM by seo

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

Thanks a lot! We invested a lot more than an hour searching for my. htaccess file and lastly observed the item due to your own personal story!