473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Ajax Toolkit: CascadingDropDown - [Method Error 12030]

I'm accessing the website locally via IIS. I get an error message
shown in DropDownList2: [Method Error 12030]

I can't see what I'm doing wrong.

I changed CascadingDropDown1.Category from "Continent" to "countrys"
and my error changed to 12031 instead.

What is the purpose of this property anyway?

================================================== =====
Code
================================================== =====

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<br />
<asp:ObjectDataSource ID="ods_Continents" runat="server"
SelectMethod="GetContinents" TypeName="MandateDAL" />
<div>
Continent:&nbsp;
<asp:DropDownList ID="ddlContinents" runat="server"
DataSourceID="ods_Continents"
DataTextField="ContinentName"
DataValueField="ContinentID" />
<br /><br />
Country:&nbsp;<asp:DropDownList ID="ddlCountries"
runat="server" /><br /><br />
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown1"
runat="server" Category="countrys"
LoadingText="Please wait..."
ParentControlID="ddlContinents" PromptText="Select a Country"
TargetControlID="ddlCountries"
ServicePath="CountryService.asmx"
ServiceMethod="GetCountriesByContinentId" />
</div>
</form>
</body>
</html>
================================================== =====
CountryService.asmx (code behind)
================================================== =====

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;

/// <summary>
/// Summary description for CountryService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class CountryService : System.Web.Services.WebService
{
public CountryService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public CascadingDropDownNameValue[] GetCountriesByContinentId(string
knownCategoryValues, string category)
{
StringDictionary kv =
CascadingDropDown.ParseKnownCategoryValuesString(k nownCategoryValues);
int continentId;
if (!kv.ContainsKey("ContinentName") || !
Int32.TryParse(kv["ContinentName"], out continentId))
{
return null;
}
DataTable countrys = MandateDAL.GetCountries(continentId);
List<CascadingDropDownNameValuevalues = new
List<CascadingDropDownNameValue>();
foreach (DataRow dr in countrys.Rows)
{
values.Add(new
CascadingDropDownNameValue((string)dr["CountryName"],
dr["CountryId"].ToString()));
}
return values.ToArray();
}
}
================================================== =====
MandateDAL.GetCountries() - This works (and has been independently
tested)
================================================== =====

public static DataTable GetCountries(int ContinentID)
{
data_connection dConn = new data_connection(true);
_connection = dConn;
if (_connection.Connect())
{
SqlCommand cmd = new SqlCommand("Watch_GetCountries",
_connection.Connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ContinentID", System.Data.SqlDbType.Int, 4,
"").Value = ContinentID;

DataTable countries = new DataTable();
countries.Columns.Add("CountryId", typeof(int));
countries.Columns.Add("CountryName", typeof(string));

SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
DataRow dr = countries.NewRow();
dr[0] = (int)reader["CountryId"];
dr[1] = reader["CountryName"].ToString();

countries.Rows.Add(dr);
}
reader.Close();
return countries;
}
else
return null;
}

Mar 29 '07 #1
0 6587

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike P | last post by:
Whenever I startup an Ajax Control Toolkit Website I get the following error: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,...
1
by: bbawa1 | last post by:
I am trying to use cascadingdropdown AJAX control but it gives me following error. have the following web method public FoodService() { //Uncomment the following line if using designed...
0
by: bbawa1 | last post by:
Hi Phani, I have two tables. I created datasets dsPrimary and dsChild. For dsPrimary.xsd my query is For first dropdown list my query is select * from tbparent For second dataset...
3
by: =?Utf-8?B?R2FyeSBM?= | last post by:
I've implemented a cascadingdropdown modeling the examples found on the web and that work fine on an initial data entry screen. What I can't seem to find an example of is after I've stored data...
2
by: kpg | last post by:
I have an AJAX enabled web service consumed by an AJAX enabled web app, given a zip code it returns the city and state. Tested the web service, it works fine. I created a services collection...
2
by: =?Utf-8?B?Q2VzYXI=?= | last post by:
I have the ASP.NET 2.0 AJAX Extensions 1.0 installed (v1.0.61025). As to the web.config file, I'm using the one created using the ASP.NET AJAX-Enabled website ... This error is due to that I'm...
0
by: wfsmith | last post by:
I have a page with a MultiView control and 6 Views. Each view has a User control that contains various form controls (dropdowns, textboxes and CascadingDropDown Ajax.Net controls). When the...
11
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit (using .net version 3.5) is closed before the Ajax enable controls complete loading, then IE locks up. Does it in both IE7...
3
by: George | last post by:
I am doing an AJAX call using JQuery on my page to which returns JSON objects and everything works fine. Now I decided to use ashx handler instead of and simply write JSON out. Then my problems...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.