Steve Clements

.Net and then some....


News

Search



MCP

Add to Google
Add to Technorati Favorites



Subscribe to this Blog by Email


this is Steve's profile
Locations of visitors to this page

My Stats

  • Posts - 125
  • Comments - 253
  • Trackbacks - 38

Twitter












Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Image Galleries


Fav Blogs


Fav Places


Services!


Top Kudos



In my last post I went over a couple of problems I am found while migrating to the new AJAX beta framework.  Mainly this was related to Web Services with a little on the Cascading drop down control...I have since got some more info in about this control so instead of updating that post I thought that the Cascading drop down deserved one all of its own!!! :)

I am only going to cover the problems I found when migrating; this is not a tutorial on using the control.  There are plenty of those around!

1.  The cascading drop down controls (there now needs to be a separate control for each drop down) needs to be in the same update panel as the drop down list controls that they extend.

2.  The web service class either needs

[Microsoft.Web.Script.Services.ScriptService]

or

using Microsoft.Web.Script.Services;

 

namespace Clm.Web.Services

{

    [ScriptService]

    public class Foo

3.  Your page methods need to be static

4.  Your page methods need to be declared in the aspx markup file (not code behind), Matt Gibbs has confirmed this as a bug and they will have a fix for it soon.  Check Rick Strahl's post here.

 

I think that's just about it !!!


posted @ Monday, October 23, 2006 9:25 PM | Filed Under [ ASP.net AJAX ]

Comments

Gravatar # re: Atlas to ASP.net AJAX: Cascading Drop Down
Posted by Saj on 11/3/2006 12:27 AM
Hi thanks for u'r post. after reading your post I was able to get cascadingdropdown working with new asp.net ajax.
My problem is i want to implement it in a sharepoint website. not in a webpart.
whenever i use cascading dropdown in the sharepoint website it breaks at CascadingDropDownBehavior.js in _setOptions method.

throws an error saying
if (list) {
for (i = 0 ; i < list.length ; i++) {
var listItemName = list[i].name;

list[i].name is undefined.

have u ever encoitered a problem like this? help is much appriciated.
thanks


Gravatar # re: Atlas to ASP.net AJAX: Cascading Drop Down
Posted by Debashis on 2/26/2008 12:46 PM
[WebMethod]
public CascadingDropDownNameValue[] GetPlantTypes(string
knownCategoryValues, string category)
{
DataTable dtPlantTable = Common.GetPlantTypes(0, out err);
List<CascadingDropDownNameValuevalues = new
List<CascadingDropDownNameValue>();
foreach (DataRow dr in dtPlantTable.Rows)
{
string sPlantTypeDescription =
(string)dr["PlantTypeDescription"];
int iPlantTypeID = (int)dr["PlantTypeID"];
values.Add(new
CascadingDropDownNameValue(sPlantTypeDescription,
iPlantTypeID.ToString()));
}
return values.ToArray();
}

[WebMethod]
public CascadingDropDownNameValue[] GetPlantVarieties(string
knownCategoryValues, string category)
{
StringDictionary kv =
CascadingDropDown.ParseKnownCategoryValuesString(k nownCategoryValues);

// string sPlantTypeID = "2";
// int iPlantTypeID = LT.Utils.CInt(sPlantTypeID);

int iPlantTypeID;
if (!kv.ContainsKey("PlantTypeDescription") || !
Int32.TryParse(kv["PlantTypeDescription"], out iPlantTypeID))
{
return null;
}

DataTable dtVarietyTable = Common.GetVarieties(0,
iPlantTypeID, out err);

List<CascadingDropDownNameValuevalues = new
List<CascadingDropDownNameValue>();
foreach (DataRow dr in dtVarietyTable.Rows)
{
string sVarietyDescription =
(string)dr["varietyDescription"];
int iVarietyID = (int)dr["varietyID"];
values.Add(new
CascadingDropDownNameValue(sVarietyDescription,
iVarietyID.ToString()));
}

return values.ToArray();
}

#endregion methods
}
}
Reply Me If u r sucessed using this webMethod
Gravatar # re: Atlas to ASP.net AJAX: Cascading Drop Down
Posted by Steve Clements on 2/26/2008 12:49 PM
You will be best placed to post your question on the asp.net forums, in the AJAX toolkit section.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: