从用户控件调用javascript函数 [英] calling a javascript function from a user control

查看:98
本文介绍了从用户控件调用javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个用户控件,并将其添加到了主页中.
在主页上有一个javascript函数(disableDiv).当我单击用户控件中的下拉列表时,我想从用户控件中调用此javascript函数(disableDiv).

Hi All, I have a usercontrol and i added it in the main page.
in main page there is a javascript function(disableDiv).when I click a dropdownlist in the usercontrol i want to call this javascript function(disableDiv) from the usercontrol. How to do that?

推荐答案

查看此线程:

http://forums.asp.net/p/924814/1071021.aspx [ ^ ]

如果您确实需要单击而不是更改所选项目,只需将 onchange 替换为onclick
See this thread:

http://forums.asp.net/p/924814/1071021.aspx[^]

If you really need it on a click rather than on a change of selected item, just replace onchange with onclick


onclick事件代替onchange事件.然后在该事件上调用函数.
Just use the onclick event in place of onchange event.and on that event call a function.


这篇关于从用户控件调用javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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