载于以下法典:
string func = "showSuccessMessage("+name+");";
ClientScript.RegisterStartupScript(this.GetType(), "success", func, true);
in a js file :
function showSuccessMessage(user)
{
$("#box").dialog({
title:"User Registration",
html: user.toString() + " Successfully Registered",
modal: true,
buttons: {
Ok: function () {
$(this).dialog("close");
var s = "../Pages/main.aspx";
window.location = s;
}
}
});
} // end function
在试图通过无任何论据的重罪时,每件事都会被罚款。
一、试图将论点纳入显示从浏览器中产生错误的职能
不详 错误:john没有定义
(john being the value of name) now i m guessing the problem occurs because the way the function is registered it can t distinguish between a the variable and the value , so it is a non-defined type john
因此,问题是:
如何从编码背后向javascript功能提出论据
thanks in advance eran.
btw similar question : showing something similar to what iv e attempted