Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2004, 08:24 AM
Authorized User
 
Join Date: Dec 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default SelectedIndexChanged

if got a listbox and dropdownlist on a form.

My problem is when an item is selected in the listbox, the listbox selectedindexchanged event fires when i clicked on the dropdownlist, i want the dropdownlist selectedindexchanged event to fire.

can anyone help me



 
Old December 14th, 2004, 09:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can you post your code?

 
Old December 14th, 2004, 11:37 AM
Authorized User
 
Join Date: Dec 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

private void ddlSort_SelectedIndexChanged(object sender, System.EventArgs e)
{
  LoadLeads();//this function populates the listbox
}

private void listLeads_SelectedIndexChanged(object sender, System.EventArgs e)
{
  Server.Transfer("frmLead.aspx?DealKey=" + Leads.SelectedValue.ToString().Trim());

}




 
Old December 14th, 2004, 11:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can you post the HTML for the list box and ddl controls?

 
Old December 14th, 2004, 09:17 PM
Authorized User
 
Join Date: Mar 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Make sure AutoPostBack is set to "True" in your dropdownlist and listbox.


 
Old December 15th, 2004, 04:37 AM
Authorized User
 
Join Date: Dec 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<asp:listbox id="listLeads" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 184px" tabIndex="2" runat="server" Font-Names="Courier New" Width="972px" Height="266px"></asp:listbox>

<asp:dropdownlist id="ddlSort" style="Z-INDEX: 111; LEFT: 544px; POSITION: absolute; TOP: 64px" tabIndex="1" runat="server" AutoPostBack="True" Width="158px" Font-Names="Verdana" Font-Size="10pt" ForeColor="Black"></asp:dropdownlist>

 
Old December 15th, 2004, 04:40 AM
Authorized User
 
Join Date: Dec 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Autopostback of the listbox is also true

 
Old December 15th, 2004, 09:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Try adding OnSelectedIndexChanged="the_appropriate_handler" for each control.






Similar Threads
Thread Thread Starter Forum Replies Last Post
dropdownlist on selectedindexchanged RoniR ASP.NET 1.x and 2.0 Application Design 4 April 6th, 2012 04:50 PM
help related to a SelectedIndexChanged event suneet.pant ASP.NET 2.0 Professional 1 May 22nd, 2008 04:41 PM
Problem with Dropdownlist.SelectedIndexChanged haydar BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 July 20th, 2007 10:26 AM
GridView SelectedIndexChanged event bnorg ASP.NET 2.0 Professional 1 July 7th, 2007 01:14 AM
Problems with SelectedIndexChanged not firing Dalik .NET Web Services 2 December 9th, 2003 02:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.