JavaScript代码无法正常工作 [英] JavaScript Code Not Working Properly

查看:51
本文介绍了JavaScript代码无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在特定条件下创建动态控件...
我在嵌入javascript时传递了控件clientid,但是它无法正常工作,这对我有帮助吗?

i m creating a dynamic control on particular condition...
i m passing the control clientid when embedding with javascript but its not working fine can any help me out here is my code

DropDownList1.Attributes.Add("onChange", "getDropDownListvalue(" + this.DropDownList1.ClientID + "," + this.Label1.ClientID + ")");







function getDropDownListvalue(dropdown,label)
{
    var IndexValue = document.getElementById(dropdown);
    var label= document.getElementById(label);
}

推荐答案

尝试以下操作:

Try this:

DropDownList1.Attributes.Add("onChange", "getDropDownListvalue(''" + this.DropDownList1.ClientID + "'',''" + this.Label1.ClientID + "'')");


这篇关于JavaScript代码无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆