level 1
shunli987
楼主
一个dropdownlist服务器控件它在前台的代码是
这样的,然后我在后台写的代码是this.DropDownList1.Attributes.Add("onchange","SelChange(document.getElementById('DropDownList1'),document.getElementById('DropDownList2')");SelChange(参数1,参数2)是个实现某个功能的函数,运行后出现的错误大概是说找不到参数,我想可能是服务器控件的代码编译后就变成了html代码,那段
旧变成了类似
这样的了,所以着个DropDownList1的id就不是原来的名字了,所以SelChange(document.getElementById('DropDownList1'),document.getElementById('DropDownList2')");里的document.getElementById('DropDownList1');参数就找不到了,所以这个函数就不能用了,换了转换成html代码后的名字就ok了.不知道还有没有其他的方法让这个函数正常运行
2007年07月30日 16点07分
1
这样的,然后我在后台写的代码是this.DropDownList1.Attributes.Add("onchange","SelChange(document.getElementById('DropDownList1'),document.getElementById('DropDownList2')");SelChange(参数1,参数2)是个实现某个功能的函数,运行后出现的错误大概是说找不到参数,我想可能是服务器控件的代码编译后就变成了html代码,那段
旧变成了类似
这样的了,所以着个DropDownList1的id就不是原来的名字了,所以SelChange(document.getElementById('DropDownList1'),document.getElementById('DropDownList2')");里的document.getElementById('DropDownList1');参数就找不到了,所以这个函数就不能用了,换了转换成html代码后的名字就ok了.不知道还有没有其他的方法让这个函数正常运行