Click here to Skip to main content
16,010,416 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Stored Procedure acting a bit strange Pin
Harini N K29-May-07 18:42
Harini N K29-May-07 18:42 
GeneralRe: Stored Procedure acting a bit strange Pin
Guffa29-May-07 19:17
Guffa29-May-07 19:17 
GeneralRe: Stored Procedure acting a bit strange Pin
J Liang29-May-07 20:31
J Liang29-May-07 20:31 
AnswerRe: Stored Procedure acting a bit strange Pin
Guffa29-May-07 19:12
Guffa29-May-07 19:12 
GeneralRe: Stored Procedure acting a bit strange Pin
J Liang29-May-07 20:27
J Liang29-May-07 20:27 
AnswerRe: Stored Procedure acting a bit strange Pin
Harini N K29-May-07 19:49
Harini N K29-May-07 19:49 
QuestionInput Validation with Dynamically created DetailsView? Pin
Nancy K29-May-07 13:49
Nancy K29-May-07 13:49 
QuestionCascadingdropdown in ajax Pin
seemamltn29-May-07 13:12
seemamltn29-May-07 13:12 
I am trying cascadingdropdown with ajax control. On my form i add 1
combobox and the cascadingdropdown control. When I run the page the
combobox displays the Select... and no options except for


[Method Error 500]


Please help me.


Here is my web service code.


using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Collections.Generic;
using AjaxControlToolkit;
using System.Data;
using System.Data.SqlClient;


///
/// Summary description for FoodService
///

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]


public class FoodService : System.Web.Services.WebService
{


public FoodService()
{


//Uncomment the following line if using designed components
//InitializeComponent();
}


[WebMethod]
// public CascadingDropDownNameValue[] GetItemsByCategoryID(string
KnownCategoryValues, string category)
// {
// string[] _categoryValues = KnownCategoryValues.Split(':',
';');
// int _foodID = Convert.ToInt32(_categoryValues[1]);
// List<cascadingdropdownnamevalue> _foodItems = new
List<cascadingdropdownnamevalue>();
// dsFoodTableAdapters.tbparentTableAdapter _foodAdapter =
//new dsFoodTableAdapters.tbparentTableAdapter();


// foreach (DataRow _row in _foodAdapter.GetFoodData())
// {
// _foodItems.Add(new
CascadingDropDownNameValue(_row["category"].ToString(),
_row["categoryID"].ToString()));


// }


// // convert to array and return the vlaues
// return _foodItems.ToArray();
// }


public CascadingDropDownNameValue[] GetItemsByCategoryID(string
KnownCategoryValues)
{
string[] _categoryValues = KnownCategoryValues.Split(':',
';');
int _foodID = Convert.ToInt32(_categoryValues[1]);
List<cascadingdropdownnamevalue> _foodItems = new
List<cascadingdropdownnamevalue>();
// dsFoodTableAdapters.tbparentTableAdapter _foodAdapter =
//new dsFoodTableAdapters.tbparentTableAdapter();
dsFoodItemsTableAdapters.tbChildTableAdapter _foodAdapter =
new dsFoodItemsTableAdapters.tbChildTableAdapter();


foreach (DataRow _row in _foodAdapter.GetData(_foodID))
{
_foodItems.Add(new
CascadingDropDownNameValue(_row["subcategory"].ToString(),
_row["subcategoryID"].ToString()));


}


// convert to array and return the vlaues
return _foodItems.ToArray();
}



}


#######################################

Below is the code for aspx page


<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default3.aspx.cs" Inherits="Default3" %>


<%@ Register Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit" TagPrefix="cc1" %>







<title>Untitled Page





<asp:scriptmanager id="ScriptManager1" runat="server">



<asp:dropdownlist id="DropDownList1" runat="server"
datasourceid="ObjectDataSource1"
="" datatextfield="category" datavaluefield="categoryID">
<asp:objectdatasource
id="ObjectDataSource1" runat="server"
oldvaluesparameterformatstring="original_{0}"
="" selectmethod="GetFoodData"
typename="dsFoodTableAdapters.tbparentTableAdapter">
<asp:dropdownlist id="DropDownList2" runat="server">


<cc1:cascadingdropdown id="CascadingDropDown1" runat="server"
category="tbChild" loadingtext="please wait"
parentcontrolid="DropDownList1" prompttext="please subcategory"
servicemethod="GetItemsByCategoryID" targetcontrolid="DropDownList2">







seema

AnswerRe: Cascadingdropdown in ajax Pin
Christian Graus29-May-07 13:46
protectorChristian Graus29-May-07 13:46 
QuestionDate time picker Pin
teddddddddddd29-May-07 10:31
teddddddddddd29-May-07 10:31 
AnswerRe: Date time picker Pin
Christian Graus29-May-07 13:47
protectorChristian Graus29-May-07 13:47 
GeneralRe: Date time picker Pin
teddddddddddd29-May-07 19:30
teddddddddddd29-May-07 19:30 
QuestionPrinting Datagrids in ASP.net Pin
umashankergr829-May-07 6:05
umashankergr829-May-07 6:05 
AnswerRe: Printing Datagrids in ASP.net Pin
Suresh Pirsquare29-May-07 7:11
Suresh Pirsquare29-May-07 7:11 
QuestionOverwriting controls contents Pin
totig29-May-07 5:42
totig29-May-07 5:42 
QuestionFTP and Virtual director Pin
Engineerusa29-May-07 5:27
Engineerusa29-May-07 5:27 
QuestionPagedDataSource Unlimited size Pin
Senseicads29-May-07 5:07
Senseicads29-May-07 5:07 
AnswerRe: PagedDataSource Unlimited size Pin
kubben29-May-07 5:25
kubben29-May-07 5:25 
GeneralRe: PagedDataSource Unlimited size Pin
Senseicads29-May-07 5:50
Senseicads29-May-07 5:50 
GeneralRe: PagedDataSource Unlimited size Pin
kubben29-May-07 5:56
kubben29-May-07 5:56 
GeneralRe: PagedDataSource Unlimited size Pin
Senseicads29-May-07 6:02
Senseicads29-May-07 6:02 
GeneralRe: PagedDataSource Unlimited size Pin
kubben29-May-07 6:25
kubben29-May-07 6:25 
QuestionError occur on start project from shared folder Pin
Nimua29-May-07 5:06
Nimua29-May-07 5:06 
AnswerRe: Error occur on start project from shared folder Pin
kubben29-May-07 5:27
kubben29-May-07 5:27 
GeneralRe: Error occur on start project from shared folder Pin
Nimua29-May-07 21:38
Nimua29-May-07 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.