[Method Error 500] In Cascading Dropdown Update In Ajax Control Toolkit

Apr 16, 2010

I am getting [MethodError 500] when I use cascading drop down. below is my code

<td >
Select a Hoster:
<asp:DropDownList ID="ddlFeaturedHoster" runat="server" ></asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="cddHoster" runat="server" TargetControlID="ddlFeaturedHoster"
PromptText="Select a Hoster" LoadingText="Loading ..." Category="ActiveHoster"
ServiceMethod="GetDropDownContents" ServicePath="~/Hosting/HostingService.asmx"/>
Service Code:
public CascadingDropDownNameValue[] GetActiveHosters()
List<CascadingDropDownNameValue> returnList = new List<CascadingDropDownNameValue>();
HostersManager hosterManager = new HostersManager();
List<Hosters_HostingProviderDetail> hosters = hosterManager.GetAllHosters();
returnList.Add(new CascadingDropDownNameValue("--Please Select One--","0",true));
foreach (Hosters_HostingProviderDetail item in hosters)
returnList.Add(new CascadingDropDownNameValue() { name=item.HostingProviderName, value= item.HosterID.ToString()});
return returnList.ToArray() ;
public CascadingDropDownNameValue[] GetDropDownContents(string knownCategoryValues, string category)
knownCategoryValues = FormatCategoryWord(knownCategoryValues);
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();
HostersManager hosterManager = new HostersManager();
switch (category)
case "ActiveHoster":
case "ActiveOffer":
return values.ToArray<CascadingDropDownNameValue>();
/// <summary>
/// Formats the category word
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
private string FormatCategoryWord(string value)
if (string.IsNullOrEmpty(value)) return value;
if (value.LastIndexOf(":") > 0) value = value.Substring(value.LastIndexOf(":") + 1);
if (value.LastIndexOf(";") > 0) value = value.Substring(0, value.LastIndexOf(";"));
return value;

View 2 Replies

Similar Messages:

AJAX :: Cascading Dropdown Method Error -1?

Dec 6, 2010

I have a cascading dropdown which loads countries into a dropdownlist.

When I type: www.domain.com, it all works.

However, when I type: domain.com it stops working and the dropdown shows: "[method error -1]"

Here's my code:

<asp:TextBox ID="tbCity" Width="90" MaxLength="50" CssClass="inactive" autocomplete="off" runat="server" />
<cc1:AutoCompleteExtender ID="AutoSuggestCities" runat="server" TargetControlID="tbCity"
CompletionInterval="2" CompletionSetCount="50" MinimumPrefixLength="3" ContextKey="" ServicePath="http://www.domain.com/geolocation.asmx" ServiceMethod="GetCitiesForCountryOrProvince" />

ps. I use url rewriting and to make sure the servicepath is always correct I used the full path.

View 7 Replies

Method Error[500] In Cascading Dropdown With Ajax?

Jan 22, 2011

i hv been tryin since a long time..but not able to resolve my problem.M making a cascadin dropdown with ajax but gettin method error 500 in my dropdown on running it..here's my code1. dataservice.cs file

using System;
using System.Web;
using System.Collections;


View 1 Replies

AJAX :: Method Error 500 In Cascading DropDown?

Jul 27, 2010

I have created a dropdown through code behind.Then created a Cascading dropdown that also through code behind.

All the properties of cascading dropdown have been initialized properly (as i think).

And web service method is defined in separate file.

DDL and Cascading DDL have been created in App_code/NewFolder through a class file. That webservice.vb file too is placed in this folder. and webservide.asmx file is placed in root directory of the project.

When i run the project dropdown is filled only with [Method error 500]. query to fetch data from database have been written in webservice.vb file without any known error.

View 3 Replies

AJAX :: Call The Server Method After The Cascading Dropdown Populated?

Oct 21, 2010

i'm using the Ajax cascading dropdown list it works fine. But how to call the server side after the dropdown list populated....

i don't want to call those method in drop down list index changed because it may cause postback..

View 6 Replies

AJAX :: Using Cascading Dropdown / Model Popup And Update Panel In Page?

Mar 13, 2010

I am using cascading dropdown, model popup and update panel in my page.

my all drop down are in update panel. now i am retrieving values from the database through data reader and assign value of respective data to the respective control. but control (drop down list) shows "--select--" and not the retrieve value i.e. "Hospital"

Following is the code:


View 2 Replies

AJAX :: Cascading DropDownList - Method Error 500

Sep 24, 2013

I would like to populate Cascading DropDownList From SQL Server.

I prepare my project the same way as in this article: [URL] ....

But all the time I have "Method error 500" I read many articles how to solve this issue but without success.

Below there are my codes:

----SQL DB has two tables:

1.tblUAP (UAP (PK), Start_Date,End_Date)
2.tblGAP(idGAP (PK),GAP,UAP(FK to tblUAP))


<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="Project1.aspx.cs" Inherits="TEST.Project1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">



using System;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

[Code] ....

What else Can I check ??

View 1 Replies

AJAX :: Control ToolKit / Error Using The Numeric UpDown Control From Ajax Control Toolkit?

Dec 8, 2010

I am Getting the following error using the Numeric UpDown Control from Ajax Control Toolkit.
Assembly 'AjaxControlToolkit, Version=3.0.30512.20315, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' contains a Web resource with name 'AjaxControlToolkit.NumericUpDown.NumericUpDownBehavior.debug.js', but does not contain an embedded resource with name 'AjaxControlToolkit.NumericUpDown.NumericUpDownBehavior.debug.js'.

View 2 Replies

AJAX :: To Submit The Values Of†cascading Dropdown Without Error It†needs To Turn Eventvalidation Off

Mar 19, 2010

I have 3 cascading dropdown lists in an update panel. To submit the values of cascading dropdown without error it needs to turn eventvalidation off. Is there any way that i can avoid turning off the event validation and still use cascading dropdown?

View 1 Replies

AJAX :: Ajax Cascading Dropdown Control Not Working On IIS After Deploying?

Jan 12, 2011

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.

Following is the .aspx and .asmx code:

.aspx code:

<form id="form1" runat="server"> <div> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <br /> <table> <tr> <td> <asp:DropDownList ID="DropDownList1" runat="server"
Height="20px" Width="257px"> </asp:DropDownList> <asp:CascadingDropDown ID="CascadingDropDown1" runat="server" Category="Category" TargetControlID="DropDownList1" PromptText="[select category]" ServicePath="~/WebService.asmx" ServiceMethod="GetCategory"> </asp:CascadingDropDown>
<br /> </td> </tr> <tr> <td> <asp:DropDownList ID="DropDownList2" runat="server" Height="20px" Width="257px"> </asp:DropDownList> <asp:CascadingDropDown ID="CascadingDropDown2" runat="server" Category="Type" TargetControlID="DropDownList2" PromptText="Select
Type]" LoadingText="Loading Type.." ParentControlID="DropDownList1" ServicePath="~/WebService.asmx" ServiceMethod="GetType"> </asp:CascadingDropDown> <br /> </td> </tr> </table> </div> </form>

.asmx code(.cs code):

public AjaxControlToolkit.CascadingDropDownNameValue[] GetCategory(string knownCategoryValues, string category)
XmlDocument _doc = new XmlDocument();
XmlNodeList list = _doc.SelectNodes("/CategoryList/Category");
List<CascadingDropDownNameValue> categorylist = new List<CascadingDropDownNameValue>();
foreach (XmlNode node in list)
string catid = node.Attributes["value"].Value.ToString();
string catname = node.Attributes["name"].Value.ToString();
categorylist.Add( new CascadingDropDownNameValue(catname,catid));
return categorylist.ToArray();
public AjaxControlToolkit.CascadingDropDownNameValue[] GetType(string knownCategoryValues, string category)
int catID;
StringDictionary selectedvalue = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
catID = Convert.ToInt32(selectedvalue["category"]);
List<AjaxControlToolkit.CascadingDropDownNameValue> cascadingValues = new List<AjaxControlToolkit.CascadingDropDownNameValue>();
XmlDocument _doc = new XmlDocument();
XmlElement root = (XmlElement)_doc.SelectSingleNode("/CategoryList/Category[@value='" + catID + "']");
for (int i = 0; i < root.ChildNodes.Count; i++)
string typeid = root.ChildNodes[i].Attributes["value"].Value.ToString();
string typename = root.ChildNodes[i].Attributes["name"].Value.ToString();
cascadingValues.Add(new CascadingDropDownNameValue(typename, typeid));
return cascadingValues.ToArray();
Xml File:
<?xml version="1.0"?>
<CategoryList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
<Category value ="1" name="SYSTEM WIDE">
<Type value ="1" name="Email"/>
<Type value="2" name="SAP Locked"/>
<Type value="3" name="Job Archive Full" />
<Category value="2" name="SAP">
<Type value="3" name="Pricing Incorrect"/>
<Type value="5" name="New Item #"/>
<Type value="6" name="Reports"/>
<Type value="7" name="New User Setup"/>
<Category value="3" name="OTHER">
<Type value="8" name="Production"/>
<Type value="9" name="Office"/>
<Type value="10" name="Toner for Printer"/>
<Type value="11" name="Security Camre Lookup"/>

View 2 Replies

Forms Data Controls :: Cascading Dropdown List In A GridView Control In Edit Mode Error

Aug 11, 2010

I'm trying to follow this article on cascading dropdown list in a GridView control in edit mode (except I'm using C#) [URL] I keep getting this error message "ProjectID is neither a DataColumn nor a DataRelation for table DefaultView."

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
if ((e.Row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit)
DataRowView dv = (DataRowView)e.Row.DataItem;
//// Preselect correct value in Projects list
DropDownList listProjects = (DropDownList)e.Row.FindControl("DropDownList1");
listProjects.SelectedValue = dv["ProjectID"].ToString(); // *****************this is where I get the error *********
// Databind list of categories in dependent drop-down list
DropDownList listCategories = (DropDownList)e.Row.FindControl("DropDownList2");
SqlDataSource dsc = (SqlDataSource)e.Row.FindControl("sdsDDL2");
dsc.SelectParameters["ProjectName"].DefaultValue = dv["ProjectName"].ToString();
listCategories.SelectedValue =(dv["CategoryID"].ToString());
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%&#36; ConnectionStrings:ttuser %>" SelectCommand="SELECT
FROM dbo.aspnet_starterkits_TimeEntry TE inner join
dbo.aspnet_starterkits_ProjectCategories CAT on
TE.CategoryID=CAT.CategoryID inner join
dbo.aspnet_starterkits_Projects P on
Where TimeEntryUserID=(SELECT UserId FROM dbo.aspnet_Users WHERE
UserName=@UserName) AND
" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE dbo.aspnet_starterkits_TimeEntry
<asp:ControlParameter ControlID="UserList" Name="UserName"
PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="WeekEnding2" Name="WeekEnding"
PropertyName="Text" />
<asp:Parameter Name="TimeEntryDescription" />
<asp:Parameter Name="TimeEntryDuration" />
<asp:Parameter Name="TimeEntryDate" />
<asp:Parameter Name="original_TimeEntryID" />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" BorderWidth="0px"
BorderStyle="None" Width="100%" CellPadding="2" PageSize="25"
DataKeyNames="TimeEntryID" onrowdatabound="GridView1_RowDataBound"
onrowupdating="GridView1_RowUpdating" >
<%--<asp:CommandField ShowEditButton="True" />--%>
<asp:BoundField DataField="TimeEntryID" HeaderText="ID"
SortExpression="TimeEntryID" InsertVisible="False" ReadOnly="True"
ItemStyle-HorizontalAlign="Center" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<asp:TemplateField HeaderText="Project" SortExpression="ProjectName">
ConnectionString="<%&#36; ConnectionStrings:ttuser %>"
SelectCommand="SELECT ProjectID,ProjectName FROM dbo.aspnet_starterkits_Projects">
<asp:Label ID="Label2" runat="server" Text='<%# Bind("ProjectName") %>'></asp:Label>
<ItemStyle HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Category" SortExpression="CategoryName">
ConnectionString="<%&#36; ConnectionStrings:ttuser %>"
SelectCommand="SELECT CategoryID,CategoryName FROM dbo.aspnet_starterkits_ProjectCategories WHERE ProjectID=@ProjectID">
<asp:Parameter Name="ProjectID" />
<asp:Label ID="Label1" runat="server" Text='<%# Bind("CategoryName") %>'></asp:Label>
<ItemStyle HorizontalAlign="Center" />
<asp:BoundField DataField="TimeEntryDescription" HeaderText="Description"
SortExpression="TimeEntryDescription" ItemStyle-HorizontalAlign="Center" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<asp:BoundField DataField="TimeEntryDuration" HeaderText="Hours"
SortExpression="TimeEntryDuration" ItemStyle-HorizontalAlign="Center" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<asp:BoundField ApplyFormatInEditMode="True" DataField="TimeEntryDate"
DataFormatString="{0:d}" HeaderText="Week Ending"
SortExpression="TimeEntryDate" ItemStyle-HorizontalAlign="Center" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<asp:CommandField ShowEditButton="True" HeaderText="Edit" ButtonType="Image" EditImageUrl="images/icon-edit.gif"
UpdateImageUrl="images/icon-save.gif" CancelImageUrl="images/icon-cancel.gif" />

View 3 Replies

AJAX :: CascadingDropDown - Method Error 500 Only For One DropDown And Service Path Is Correct

May 7, 2015

I have 3 table in database


Id state
2 UK


Id name state
1 Canada USA
2 London UK


Id regionname cityid
1 01 Canada
2 02 London

and I have 3 DropDownList that refer below thread [URL] ...

I use cascadingdropdown for these 3 dropdownlist below are codes:


public CascadingDropDownNameValue[] GetCountries(string knownCategoryValues)
string query = "SELECT state FROM stateTest";
List countries = GetData(query);
return countries.ToArray();

[Code] ....




at first I should select Item from DDLsate then DDlcity and at the end I should select Item from DDLregion

above code work correctly for ddlstate and ddlcity but it doesn't work for ddlregion...

I mean when I select Item from ddlcity in ddlregion shows:[Metod error500]

View 1 Replies

Error Using Editor Control From Ajax Control Toolkit / Value Cannot Be Null Or Empty

Mar 27, 2011

When trying to use the editor control i'm getting the following error:

Value cannot be null or empty.

Parameter name: elementID

Here's my HTML:


I'm using asp.net 4 with ajax control toolkit for version 4.

I believe the error is talking about the routing I have. Is there something special I have to do if I want to use the toolkit and custom routing?

View 1 Replies

Error Trying To Add Ajax Control Toolkit To Toolbox

Jul 13, 2010

ive used the Ajax Control Toolkit in previous versions of VWD but for some reason im having trouble adding the Toolkit to the toolbox in this new version (2010) i have setup on my laptop, when i browse to and select the .dll file it gives me the error "Object reference not set to instance of an object" can anyone please help ive been trying to fix this issue for a little over an hour now.

View 1 Replies

AJAX :: Error With Adding Control Toolkit

Apr 27, 2016

The type or namespace name 'ToolkitScriptManager' does not exist in the namespace 'AjaxControlToolkit' (are you missing an assembly reference?)

View 1 Replies

AJAX :: Error With Control Toolkit - Requires 4.0 Scripts

Aug 25, 2010

This is the error i get in the browser. Update panel is workingBut Accordion,Rounded Corners Extender & much more controls does'nt workRESTARTING Visual Stuio does'nt help!

View 1 Replies

AJAX :: Control Toolkit Causes WCF Error / $inetinfo Is Undefined

Apr 16, 2010

I am using both the AJAX Control Toolkit HTMLEditor and making AJAX WCF calls from my web form. Since we can only have one Script Manager per page, I am using this:


When my page loads, I do an initial AJAX WCF call and it works.

But if I try to make an AJAX WCF call after the page has finished loading, I get the following error:

$inetinfo is undefined

If I take out the AJAX Control Toolkit script manager and replace it with this:


Then my WCF AJAX works fine, but my HTMLEditor does not.

View 1 Replies

AJAX :: Control Toolkit Filtered TextBox Error?

Nov 9, 2010

wanna use filtered TextBox ajax control in my simple page.I add a textbox in my page. And then i drag first script manager on my page and then drag filtered textBox in my textbox.But when i run my project i had an error like this picture..What is the problem? Where i doing mistake?

View 4 Replies

AJAX Toolkit 'unknown Server Control' Error?

Jan 14, 2011

I just installed Ajax Toolkit. The controls are available in my Toolbox, but when I insert them in a page, Visual Studio underlines them with the error message "unknown server tag".

I googled the problem and found several ideas :

check if the DLL is in Bin folder check if ajaxToolKit tags prefix is registered in web.config and make sure I'm not using a different prefix in my pages check if the DLL is registered in the pages with <% @ Register ... %>

Unfortunately all of this is fine, but I still can't get the controls to work. Is something else missing ?

EDIT : My environment is ASP.Net 2.0, Ajax Extensions 1.0, Ajax Toolkit 1.0.20229, Visual Studio 2005

View 1 Replies

AJAX :: Control Toolkit , Gridview And Jquery Error?

Dec 31, 2010

Me using Vb.net and Ajax control tool kit with Database Sql server.My problem is that When I select one Radiobutton list it genrates only one row in gridview and when i select another button it throws error like ".non MS DOM browser is undefined."and sometimes " document.getElementByid() is null or not an object" OR ".javaScript_dopostback.".I have few componets on my page

1. RadioButtonList Which is placed inside Update panel1 first.
2. GridView Which is placed inside Update panel2 second..and Gridview generated five Textboxes Dyanamically in which i have used autocomplete extender with one textbox.
3. I have also used Ajax tool kit extender for calender control.
4. I am also using Jquery and master page too.
5. i am generating new row on textchange event of one of the textbox in grid view.So how can i do all the above functionality properlly.

My problem is that When I select one Radiobutton list it genrates only one row in gridview and when i select another button it throws error like".non MS DOM browser is undefined." and sometimes " document.getElementByid() is null or not an object" OR ".javaScript_dopostback."

View 1 Replies

AJAX :: Getting Error When Try To Add Ajax Toolkit Dll File To Ajax Control Tab?

Dec 22, 2010

When iam try to add ajax control dll file to my ajax toolkit given in visualstudio express edition 2005, i am getting the following error.

"There are no components in 'C:ProgramFilesMicrosoft ASP.NETASP.NET 2.0 Ajax Extensionsv1.0.61025AJAXExtensionsToolbox.dll' that can be placed on the toolbox." what is the error in this?

View 2 Replies

AJAX :: Control Toolkit Combobox Produces An Error 800a025e?

Oct 4, 2010

I have a ajax combobox in my page, when i try to select an item from it i can select by typing in text and its selectedindexchanged event fires, but when that event is complete and when i try to select another item from the combobox it produces the following error:

could not complete operation due to error 800a025e,and an alert asks me if i want to debug it.If I press yes then i get this page:

// Name: AjaxControlToolkit.ComboBox.ComboBox.debug.js
// Assembly: AjaxControlToolkit
// Version: 3.0.30930.28736
// FileVersion: 3.0.30930.0
/// <reference name="MicrosoftAjax.js"/>

htmlfile: Could not complete the operation due to error 800a025e.

_setTextSelectionRange: function(textBox, selectionStart, selectionEnd) {

// set the selection range on the text box[code]....

The Weird thing about this is that the error does not occur on the development machine but only on the server.

View 2 Replies

AJAX :: Remove The Configuration Error Found In The Control ToolKit?

Nov 24, 2010

How do I remove the Configuration Error found in the ASP.Net Ajax Control ToolKit?

Error Message reads: "The Master Page file .... DefaultMaster.master cannot be loaded Correct the problem in Code view"

<%@ Page
Title="HoverMenu Sample"
Theme="SampleSiteTheme" %>

View 3 Replies

AJAX :: Error When Using Control Toolkit - Could Not Load Type From Assembly

Jun 13, 2012

System.TypeLoadException: Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

View 1 Replies

Cascading Comboboxes To Work - Getting Method Error 500

Jan 31, 2011

I am trying to get my cascading comboboxes to work, but am getting a [Method error 500]. Any ideas? I've searched online, the code should work....Thanks in advance for your help!


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="addstory.aspx.cs" Inherits="addstory" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ScriptManager1" runat="server" />
<td class="style3">
<asp:DropDownList ID="selectproject" runat="server" Width="225"></asp:DropDownList>
<asp:CascadingDropDown ID="ccd1" runat="server"
ServicePath="~/dropdown.asmx?company=<%=co_id %>" ServiceMethod="GetProjects"
TargetControlID="selectproject" Category="Project"
PromptText="Select Project" />
<td class="style3"></td>
<td width = "150" class="style3">Iteration:</td>
<d class="style3">
<asp:DropDownList ID="selectiteration" runat="server" Width="225"></asp:DropDownList>
<asp:CascadingDropDown ID="ccd2" runat="server"
ServicePath="~/dropdown.asmx?company=<%=co_id %>" ServiceMethod="GetIterations"
TargetControlID="selectiteration" Category="Iteration"
PromptText="Select Iteration" />
using System.Web.Script.Services;
using AjaxControlToolkit;
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data.SqlClient;
/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "[URL]/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
public class dropdown : System.Web.Services.WebService
private string GetConnectionString()
return System.Configuration.ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
public CascadingDropDownNameValue[] GetProjects(string knownCategoryValues, string category)
string co_id = this.Context.Request.QueryString["company"].ToString();
SqlConnection conn = new SqlConnection(GetConnectionString());
SqlCommand comm = new SqlCommand("Select ProjectName, ProjectID FROM Project WHERE CompanyID = '" + co_id + "'", conn);
SqlDataReader dr = comm.ExecuteReader();
List<CascadingDropDownNameValue> l = new List<CascadingDropDownNameValue>();
while (dr.Read())
l.Add(new CascadingDropDownNameValue(dr["ProjectName"].ToString(), dr["ProjectID"].ToString()));
return l.ToArray();
public CascadingDropDownNameValue[] GetIterations(string knownCategoryValues, string category)
int ProjectID;
StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
if (!kv.ContainsKey("Project") || !Int32.TryParse(kv["Project"], out ProjectID))
throw new ArgumentException("Couldn't find project.");
SqlConnection conn = new SqlConnection(GetConnectionString());
SqlCommand comm = new SqlCommand("SELECT Select CONVERT(VARCHAR(10), StartDate, 103) + ' - ' + CONVERT(VARCHAR(10), EndDate, 103) AS Iteration, ProjectIterationID FROM Iterations WHERE ProjectID=@ProjectID", conn);
comm.Parameters.AddWithValue("@ProjectID", ProjectID);
SqlDataReader dr = comm.ExecuteReader();
List<CascadingDropDownNameValue> l = new List<CascadingDropDownNameValue>();
while (dr.Read())
l.Add(new CascadingDropDownNameValue(dr["Iteration"].ToString(), dr["ProjectIterationID"].ToString()));
return l.ToArray();

View 1 Replies

Copyrights 2005-15 www.BigResource.com, All rights reserved