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 don't want to link my dropdownlists with a database like most of tutorials and forums show. I just want to link 2 dropdownlists, for instance if one says "Food" I want to show only the food producs in the other DropDownList. All this items are not from a database, I just inserted them in the DropDownList control.
I am using the AJAX Cascading drop down list but want to add event validation e.g. the compare validators.
As the cascading drop down list requires the page event validation to be disabled what is the best way to do the validation?
Validation Attempt: I have tried to use a custom validator which calls a Javascript function but it doesnt seem to be picking up the control. I get the following error Microsoft JScript runtime error: Object required
function ValidateCostCentCat(source, arguments) { var countryList = document.getElementById("ddlCategory"); if (null != countryList) { var iValue = countryList.options[countryList.selectedIndex].value; if (iValue == "Select Category") { arguments.IsValid = true; } else { arguments.IsValid = false; } } }
The mark-up for the custom validator is
<asp:CustomValidator ID="valcustCategory" runat="server" CssClass="error" Display="Dynamic" ValidationGroup="DirectHire" ClientValidationFunction="ValidateCostCentCat" ErrorMessage="Please select a Cost Centre Category from the drop down list provided.">!</asp:CustomValidator>
I am new to Ajax in general but I have a series of cascading drop down lists that are working fine. I'm using them on a form that I want to be able to either add a new row of data to the database or edit an existing one. I have the insert a new row working but editing an existing one is a bit trickier. The drop down lists are only part of the form but I would like to be able to query for a row id and set their values. Right now I'm querying for a row of data and populating the form with its values on page load and all of the fields work except for the drop down lists. I assume that this is because when the page is loading the web methods haven't run yet to populate the cascading drop downs. Therefore I can't set the selected value because there aren't any values yet. So therefore I'm pretty sure I need to do this from a web method so that it runs after the lists are populated or while the lists are populating but I don't know how.
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...
I have masterpage which includes dropdown list for choosing skins for page.
Also I have Home.aspx include above master page. This Home.aspx contains update panel[up1] which further comprises of gridview, link button, image button[IB] and dropdown list. Also there is one modal popup that has a panel which includes dropdown and text box.
Requirement: when i click image button[IB], modal popup opens up and home.aspx gets grayed up.
Issue: when i click image button[IB], modal popup opens up, but all dropdowns placed in[Home.aspx and Master page] get disappeared[invisible]. Once i close modal popup , they are visible.
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 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.
I have 3 cascading dropdowns in a user control. I am trying to clear off the values of the dropdowns on the click of the clear or cancel button on the page. I am setting the value as selected index as 0 but the last dropdown never gets disabled. How do i achieve that. Is there a way that i can set only the first dropdown and the rest of the dropdowns get disabled.
Bit of a strange request but is it possible to set the selected value of a cascading dropdown in code? I have 2 dropdowns, the second is populated using the value of the first. Heres my markup:
I have a RadioButtonList and two cascading dropdown linked to corrspoding dropdown control. Based on radiobutton's selection, the cascading will be prepopulated with some values and one value is selected in both dropdown.
I want to disable the cascading dropdown/dropdown after values are filled and selected on selection of radiobutton selected in RadioButtonList.
I tried to disable it, but in that case dropdown is getting empty.
I have a web form where I have three dropdowns for Country State And City and there corresponding ajaxToolkit:CascadingDropDowns.
The dropdowns are working perfectly fine with the web service methods. i.e country loading initially and then State as per selected Country and City as per the selected City.
The problem occurs when I try to set selected values in these dropdowns as per the Values previously saved.
The Country loads properly and the selected value is set according.
The State is filled as per the selected country but its selected value is not set.
The City is not loaded at all (as the state doesn't have a selected value)