PDA

View Full Version : [CLOSED] Ext.net.DirectMethod.request returning [object Object] instead of string/RESPONSE is empty



zwf
Oct 26, 2012, 10:32 AM
function setBackground() {
Ext.net.DirectMethod.request({
url: "/Home/setStyleTest",
cleanRequest: true,
params: {
validNumber: 'txt_ES_SD'
},
success: function (styleString) {
console.log("Success : " + styleString);
Ext.getCmp('txt_ES_SD').setFieldStyle(styleString. toString());
}
});

//App.txt_ES_SD.setFieldStyle('background-color: red');
//console.log("style : " + App.txt_ES_SD.getFieldStyle());
}


public string setStyleTest(String componentId)
{
string styleString = "background-color: red";
return styleString;
}

console : [object Object]

POST : validNumber txt_ES_SD
RESPONSE : {} <------ empty ???

So, why is the response empty ? It is set to "background-color: red"

Regards,
Holger

Daniil
Oct 26, 2012, 11:33 AM
Hi Holger,

Please use:

public ActionResult setStyleTest()

{

return this.Direct("background-color: red");

}

zwf
Oct 26, 2012, 4:10 PM

Daniil
Oct 26, 2012, 4:49 PM
Please provide a full test case to reproduce.

zwf
Oct 27, 2012, 10:59 AM
Please provide a full test case to reproduce.

Didn't have
ActionResult
as return value ......

Regards,
Holger