Hi, I wants to ask about how to call the javascript function/method in .aspx file from code behind(or server code)?
for example:
Javascript:
function initCard(userid) {
//userid, balance, subsidy breakfast, subsidy lunch, subsidy dinner
var iRet = winCtrl.initCard(userid, 0, 0, 0, 0);
}
code behind:
Dim sb As New StringBuilder()
Dim int As Integer = 12
sb.Append("<script type=""text/javascript""> function initCard(" & int & "{")
sb.Append("var iRet = winCtrl.initCard(" & int & ", 0, 0, 0, 0);} </")
sb.Append("script>")
Page.ClientScript.RegisterStartupScript(Me.GetType(),"ClientScript",sb.ToString, True) Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),"ClientScript",sb.ToString,True)
After I run the program, it does not affect anything.Anyone can help?