如何从asp.net c#
调用addRect
函数
我尝试了这个,但它无法调用该函数,我应该使用什么?
(function (window) {
function addRect(x, y, w, h, fill, flag, count) { }
})(window);
Page.ClientScript.RegisterStartupScript(this.GetType(), "addRect", "addRect(x,y,w,h,fill,flag,count);", true);
答案 0 :(得分:0)
试试这个;
<script type="text/javascript" language="javascript">
function myfunction(x) {
alert(x)
}
</script>
并从你的代码背后;
string myfunction= "myfunction(" + myvalue+ ")";
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "myfunction", myfunction, true);