473,734 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open new window using dropdownlist selectedvalue

36 New Member
I would like to open a new window to a url that I have set as the dropdownlist.se lectedvalue 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_Se lectedIndexChan ged(object sender, EventArgs e)
{
Response.Redire ct(this.ddl.Sel ectedValue);
}
Apr 10 '07 #1
2 2534
JSha
17 New Member
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....op en a window...

so..



private void Select_Changed( object sender, System.EventArg s e)
{
System.Text.Str ingBuilder sb = new System.Text.Str ingBuilder();
sb.Append("<scr ipt language=\"java script\">\n");
sb.Append("wind ow.showModalDia log"+"('"+this. DropDownList1.S electedValue+"' , null, 'dialogHeight:6 00px;dialogWidt h:600px;scroll: no;status:no;') ;" + System.Environm ent.NewLine);
sb.Append("</script>");
Page.RegisterCl ientScriptBlock ("trail", sb.ToString());


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

Response.Redire ct(DropDownList 1.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.se lectedvalue 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_Se lectedIndexChan ged(object sender, EventArgs e)
{
Response.Redire ct(this.ddl.Sel ectedValue);
}
Apr 11 '07 #3

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

Similar topics

1
6488
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 any suggestions! Thanks! The connection is already Open (state=Open). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where...
3
6197
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) e.Item.FindControl("DdlTest") enables me to work with ddlTest - with, for example, ddlTest.SelectedValu However, in DataGrid1_EditCommand, ddlTest.SelectedValue returns "Object reference not set to an instance of an object.
1
16907
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 of its value. Here is the code: If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItem.AlternatingItem Then Dim ddl as DropDownList = Ctype(e.Item.FindControl("ddl"), DropDownList) With ddl
3
2703
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 set to a predetermined value. I can set the SelectedItem property easy enough and get the dropdownlist to work fine just so long as the dropdownlist is just on the form itself not in a DataList control.
15
26926
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" DataTextField="name" DataValueField="ID"></asp:DropDownList><asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
1
2368
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. -- .. http://sf-f.org, weblog and search engine for fans and writers of
5
3090
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 and then update panel and some control in it to test it. When i run the programme ir does not work . imean ajax does not works
1
4701
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 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); }
1
4937
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 time. The problem is that when an item has been removed from the lookup table, and a user wants to retrieve a record that used the deleted item, the following error occurs: 'ddlAssignedTo' has a SelectedValue which is invalid because it...
0
8776
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.