Sep 13, 2011, 4:47 PM
[CLOSED] DirectMethod question - simple string returning as [Object - object]
Hi, I have a simple DirectMethod being called from a javascript function:
Using the example on #2 in https://examples1.ext.net/#/Events/D...hods/Overview/, I would have thought I would get back a string...
Am I doing something wrong?
Ext.net.DirectMethods.GetSectorTeam(hidEntityId.getValue(), hidEntityTypeId.getValue(),
{
success: function (result) {
alert(result);
UpdateStore(gridActivities.getSelectionModel().getSelected().data.ActivityInProgressId, 'SectorTeam', result);
cmboSector.setValue(result);
hidSectorTeam.setValue(result);
storeAnalyst.reload();
}
});
Server-Side: [DirectMethod]
public static string GetSectorTeam(int entityid, int entityTypeId)
{
String st=string.Empty;
if ( entityTypeId.Equals(1) )
{
Company c = Company.FetchByID(entityid);
st = c.SectorTeam;
}
return st;
}
Using the example on #2 in https://examples1.ext.net/#/Events/D...hods/Overview/, I would have thought I would get back a string...
Am I doing something wrong?
Last edited by Daniil; Sep 19, 2011 at 6:17 PM.
Reason: [CLOSED]