AJAX :: Cascading Dropdown SelectedIndexChanged Doesn't Fire
Jun 11, 2010
I just wanted to clarify if selectedIndexChanged works on ajax cascading dropdowns as mine doesn't fire. Its in a user control inside an accordion pane. I've read conflicting things about this. All I want to do is check that the last of the 3 cascading dropdowns has been populated an enable a button if so.... but the event never fires when i make a selection on the last dropdown. If it isn't suppose to fire is there a way to raise an event when the selection is made and unmade (as when you change one of the other dropdowns the value resets and the buttton needs to be disabled.
I have 2 DropDownLists and use a cascadingdropdown to populate them which works fine. Problem I have is that I aso set the selectedvalue of the first DDL via Javascript. This doesn't then cascade the second DDL.
Code (for what its worth):
function SetControls(intAppId, intDelegateId){ var ddlApplication = document.getElementById('<%= ddlApplication.ClientID %>'); var ddlDelegate = document.getElementById('<%= ddlDelegate.ClientID %>');
I have a RadioButtonList with some fixed element and a default selected. If I uncheck the selection with javascript, on postback the SelectedIndexChanged event is not fired.
I would expect that the SelectedIndexChanged is called because the index is changed to -1.
As far as I know, the stage of data collection from the submit of the form is handled by IPostBackDataHandler.LoadPostData method.
I derived a class from RadioButtonList to verify when LoadPostData is called and I noticed that when non of the radio button is selected the method is not called and the same for SelectedIndexChanged event.
it seems that if the key of RadioButtonList is not present in the Page.Request.Form.Keys array, the LoadPostData is not called.
I've got a UserControl that's used inside of an UpdatePanel. The UserControl is a fairly simple form that appears via a ModalPopupExtender (which is also part of the UserControl). There are four DropDownLists, as well as some other UI elements. Three of the four DropDownLists have AutoPostBack="true", with SelectedIndexChanged events that fire on the server and cause some of the other DropDownLists to rebind. Two of the three DDL's that AutoPostBack are working fine. One of them, which I only just added, is showing some strange behavior. Let's say I bind five Items to it: 1, 2, 3, 4, 5. I set the SelectedIndex to 0, which makes 1 the selected item. If I select 5 and then 1 and keep toggling back and forth, everything works fine. The postback occurs and SelectedIndexChanged fires. Every time. If I ever select 2 or 4, the postback occurs but SelectedIndexChanged does not fire. Every time.
If I ever select 3, something bizarre happens and sometimes the value of the DDL reverts to 1. Even though breakpoints seem to show that it's not rebinding and no unexpected code is running. I know your first instinct will probably be that I'm wrong about the rebinding code not running, but I have literally been staring at the debugger for hours trying to find my mistake. Lots of breakpoints. I don't get it -- this really isn't that complicated. But obviously I am missing something. I've put about four hours into this so far and I think I'm just grinding at this point. I could use another perspective.
HTML (and by the way, DropProtocolCycleID is the problem control): <asp:Panel ID="PanelPopupAssign" runat="server" Style="display:none; cursor: move; width:325px; background-color:Transparent;"> <BlueUI:Panel runat="server" ID="PanelPatientProtocol" Width="500px" HeaderText="Assign Protocol"> <table cellspacing="5"> <tr> <td style="width:150px;"></td> <td style="width:50px;"></td> <td style="width:125px;"></td> </tr> <tr runat="server" id="TableRowCategory"> <td align="right">Category:</td> <td colspan="2"> <asp:DropDownList runat="server" ID="DropProtocolCategories" CausesValidation="false" autopostback="true"/> </td> </tr> <tr> <td align="right">Protocol:</td> <td colspan="2">..............................
I create a dropDownList in code-behind, in selectIndexChange of another dropDownList, and add this new dropDownList to page using a placerHolder, everthing its ok, but new dropdownlist selectIndexChange event dont fire!
I have a dropdown list that is populated by a dataset (Data being extracted from DB). Based on the selection made by the user I call OnSelectedIndexChanged, and populated the form with the relevent info. The problem I am having is the first item in the list is selected by default, so if the user selects this option OnSelectedIndexChanged does not fire. To work around this I add a default item to the dropdown list after populating it with the dataset as shown here;
jobStandardActList.Items.Insert(0, jobStandardActList.SelectedIndex = 0; jobStandardActList.SelectedValue = "----Select an Item----");"";
This works fine, however if the user selects an item from the list, and then proceeds to selects the default item "----Select Item----" i receive an error. sys.webforms.pagerequestmanagersevererrorexception: an unknown error occured while processing the request on the server. The status code returned from the server was: 500
I have a usercontrol and in that i have a dropdown. i need async postback for dropdown selectedindexchanged event. i set the AutoPostBack=true for dropdown. Eventhough the event is not getting fired.
I tried cascading dropdown in asp.net using ajax. I have tried with 3 dropdown control. The scenario is First dropdown is loaded when page gets loaded and the second dropdown is loaded based on first is selected and thrid dropdown is loaded based on second one selected, now I want to know how do I load third dropdown based on first and second selected value...
and this aspx page [Code].... perhaps i followed this example here http://programming.top54u.com/post/AJAX-Cascading-Dropdown-Example-using-SQL-Database.aspx
it return an error that System.InvalidCastException: unable to cast di object of 'AjaxControlToolkit.CascadingDropDown' on tye 'System.Web.UI.WebControls.DropDownList'.
Suppose parent dropdown is car (Values are car1, car2, car3)and its child is color(for car1 R Y G B, For car2 R Yand for car3 G B).Now on selection of car2 R and Y will appear and select R, then again made the change on car and select car3 then again select is comiing with G and B and select B.
Now if I select again in car, car1 then the child is populating with the values of car1 but it takes the B as a default value as it was previously selected and also present for car1 too.This case is only happen. on select of child value which is availble for both parent selection.
I have a cascading dropdown which is dynamically created and does a postback based on a certain condition. How do i set the selected value after the postback
I am using Cascading Dropdown nad would be populating the values of the second dropdown from the session thats created when the page load.With the initial page load, the cascading dropdown works fine. But when I change the selection for the first one, the session values are not retained.
I have been trying to make a cascading drpdown using ajax using this link [URL] But m nt getting a clear picture abt it.. I have a table 'car' with fields of 'id','make','model','color'. I have 2 dropdowns on my form for make & model.I want to populate the model dropdown using the make dropdown but without postback.Till nw I have tried this :-
using System; using System.Web; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Web.Services; using System.Web.Services.Protocols; using AjaxControlToolkit; using System.Data; using System.Data.SqlClient; using System.Configuration; //using System.Web.Script.Services.ScriptService;.............................
I have a user control in which i have implemented Cascading dropdown. It works perfectly fine in IE but doesnt in Firefox. I am using webservice to get my data for the dropdowns.
I am binding the dropdownlist by using ajax cascading drop down now i need to preselect the dropdown value in code behind page in page load (for update operation) is it possible
I am new to Ajax Control Toolkit, with the help of online tutorials I had created a cascading dropdown list in asp.net and tested it on my local machine. For this dropdown list data source would be an xml file (which is saved on my local machine c drive). I haven't encountered any issues until I deploy the precompiled web site on to IIS 7. When I open the web site from IIS I would see the two dropdown boxes on the web page with an error "Method error 500". I believe this error occured due to incorrect xml file path provided on IIS. I had copied xml and xsd files into IIS server C drive but it did not help out and then I created a network map and placed the xml and xsd files in that shared folder tried to access that path from web service, it's working on local machine but not on IIS. It would be great, if any one could explain me the solution.
I have 3 dropdown lists. All 3 are using the same generic list for there items. I am using C# as the code behind. The code below shows the DTO list i am using and how I'm adding them to the drop downs...
I want to populate the cascading Dropdown values without Promttext.
Scenario is .If a single value is retrived from the database then I think no need to populate the promt text. It may populate only that value and call the next function from the inside of it. Can it be possible using web methods.
I am new to using Ajax Control toolkit. I need to create a dynamic cascading dropdowns in which the no of dropdowns will be programatically decided. Also the last dropdown can be replaced with a listbox as well. how i can leverage the Ajax toolkit's cascading dropdown.