62,046
社区成员
发帖
与我相关
我的任务
分享
function GetNumber() {
UseCallBack();//为什么这里不用传参数?
}
function JsBack(TextBox1,context) {
document.getElementById("TextBox1").value = TextBox1;
}
private string callbackResult;
protected void Page_Load(object sender, EventArgs e)
{
string str = Page.ClientScript.GetCallbackEventReference(this, "arg", "JsBack",null);
string cbstr = "function UseCallBack(arg, context)" +
"{" + str + ";"+"}";
//是不是这两个参数必须和GetCallbackEventReference参数第二个和第四个一致?
Page.ClientScript.RegisterStartupScript(this.GetType(),"UseCallBack",cbstr,true);
}
#region ICallbackEventHandler 成员
public string GetCallbackResult()
{
return callbackResult;
}
public void RaiseCallbackEvent(string eventArgument)
{
Random rnd=new Random();
callbackResult = rnd.Next().ToString();
}