Hi, I am looking write a javascript method as such called when a dropdownlist changes value
function GetStuff(sender, destID){
var dest = document.getElementById(destID);
this.PageMethods.GetStuffs(sender, dest, null, null);
}
GetStuffs() is in the Codebehind as follows:
[WebMethod]
public static void GetStuffs(object sender, object dest)
{
DropDownList s = sender as DropDownList;
DropDownList d = dest as DropDownList;
d.Items.Add(new ListItem(s.SelectedValue));
}
I have a break point set at the method and alerts in the GetStuff() jscript method fire up until the PageMethod call, at which nothing happens. I have set OnSuccess and OnFailure methods up with alerts and they don't get fired.
Any thoughts? Am I doing something inherently wrong?