jjzjj

ExampleButton

全部标签

c# - ASP.NET 用户控件中的 Javascript 函数

我用javascript函数创建了ASP.NET用户控件:functionexample(){alert('');returnfalse;}我想在用户将鼠标移动到按钮时调用“example”函数,所以我为按钮添加了属性:ExampleButton.Attributes.Add("onmouseover","example()");它运行良好,但是当我需要在同一个页面上使用两个控件时,我遇到了问题。ASP.NET生成具有两个同名函数的代码,错误是什么:functionexample(){alert('TestControl1_ExampleButton');returnfalse;}fu