如何从内容页面调用外部js文件? [英] How to call external js file from content page?
本文介绍了如何从内容页面调用外部js文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在.js文件中的Java脚本代码是
my Java script code in .js file is
function fillTextBox() {
var dropdown = c.selectedIndex;alert("fdgdfg");
var selvalue = c[dropdown].value;
if(selvalue=="True")
{
v.value=1;
}
else
v.value=0;
}
我将我的网页控件分配给aspx页面中的变量
< script type =text / javascriptsrc =../../ JavaScript / UserFunctions.js>< / script>
I assigned my web controls to variables in aspx page
<script type="text/javascript" src="../../JavaScript/UserFunctions.js"></script>
<script type="text/javascript" language="javascript">
var c= document.getElementById('<%= ddlCompanyChit.ClientID %>');
var v=document.getElementById('<%= txtTcktNum.ClientID %>')
</script>
我从后面的代码调用函数
and am calling the function from code behind
ddlCompanyChit.Attributes.Add("OnChange", "fillTextBox()");
我认为问题是.js文件找不到网页控件..所以请提供如何将网页控件传递给.js文件的解决方案?
I think the Problem is .js file could not find the web controls..so please provide the solution for how to pass web controls to .js file?
推荐答案
查看下面的链接
点击这里 [ ^ ]
Check the bellow link
Click Here[^]
这篇关于如何从内容页面调用外部js文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文