一般来说,我将使用下面的代码来绑定客户模型,
[HttpPost]
public ActionResult Create(Customer model)
{
...
}
Run Code Online (Sandbox Code Playgroud)
现在,我想稍后提高绑定,而不是立即提高绑定
[HttpPost]
public ActionResult Create()
{
//some operations first
...
//binding will start here
var model={Bind - To - Customer}
...
}
Run Code Online (Sandbox Code Playgroud)
所以,我怎么能实现这一点,是否可能?
非常感谢任何建议
检查此代码
var _class=function()
{
this.Test=100;
this.Callback=function(msg)
{
alert(msg+"\r\n"+this.Test);
}
}
function run(call)
{
call("Hello world");
}
var obj=new _class();
run(obj.Callback);
Run Code Online (Sandbox Code Playgroud)
我得到了结果:
[Alert]
Hello world
undefined
Run Code Online (Sandbox Code Playgroud)
但是当我打电话给obj.Callback("你好世界")
我得到了预期
[Alert]
Hello world
100
Run Code Online (Sandbox Code Playgroud)
为什么?
谢天谢地