473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Open new window using dropdownlist selectedvalue

36
I would like to open a new window to a url that I have set as the dropdownlist.selectedvalue on the selected index change event. The selectedvalue is the url path and it will open in the existing window. I've tried window.open before the url, but that doesn't work.



protected void DropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect(this.ddl.SelectedValue);
}
Apr 10 '07 #1
2 2513
JSha
17
Hello ,
See if this works....


Got a dropdownlist box......values are same as the text....i.e urls.....

added even to the dropdownlist..... Select_Changed

when event gets triggered....open a window...

so..



private void Select_Changed(object sender, System.EventArgs e)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script language=\"javascript\">\n");
sb.Append("window.showModalDialog"+"('"+this.DropD ownList1.SelectedValue+"', null, 'dialogHeight:600px;dialogWidth:600px;scroll:no;st atus:no;');" + System.Environment.NewLine);
sb.Append("</script>");
Page.RegisterClientScriptBlock("trail", sb.ToString());


}
Apr 10 '07 #2
prabunewindia
199 100+
hi friend,
try with this one

Response.Redirect(DropDownList1.SelectedItem.Text) ;
its working with my project
Prabu

I would like to open a new window to a url that I have set as the dropdownlist.selectedvalue on the selected index change event. The selectedvalue is the url path and it will open in the existing window. I've tried window.open before the url, but that doesn't work.



protected void DropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect(this.ddl.SelectedValue);
}
Apr 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ST | last post by:
This is my other error when I click on Immunoflourescence. I believe this is related to the other error I just posted (Input string was not in a correct format.) Please let me know if you have...
3
by: mg | last post by:
I have a DataGrid (WebForm - C#) that has a template column that contains a dropdownlist named "DdlTest" In DataGrid1_UpdateCommand, the lin DropDownList ddlTest = (DropDownList)...
1
by: Shaun Camilleri | last post by:
Hi all, I am creating a DropDownList in a RepeaterControl. After the Repeater is DataBound in the ItemCreated event (of the Repeater) I bind the DropDownList to a Table and then try to select one...
3
by: sling blade | last post by:
Hi, I have a dropdownlist in my DataList control and I am trying to set the SelectedItem property of the dropdownlist so when the datalist displays the user will see the text in the dropdownlist...
15
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3"...
1
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
5
by: Mukesh | last post by:
Hi i want to use AJAX.net in my Existing Application I have already installed the ajax .net ..net 3.0 and using VS 2005 in the old application i have added a new web form then script manager...
1
by: wbosw | last post by:
I would like to open a new window to a url that I have set as the dropdownlist.selectedvalue on the selected index change event. The selectedvalue is the url path and it will open in the existing...
1
by: Brett | last post by:
I have a DropDownList in an ASP.NET web form that is populated with items from a lookup table by binding that DropDownList to a SqlDataSource. However, the items in the lookup table can change over...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.