如何在.ascx页面中使用javascript [英] How to use javascript in .ascx pages
本文介绍了如何在.ascx页面中使用javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在.ascx页面中使用javascript
How to use javascript in .ascx pages
推荐答案
您可以在标记中添加脚本标记:
You can add script tags to the markup:
<script type="text/javascript">
// place your javascript here
</script>
<script type="text/javascript" href="path to js file" />
或者使用 ScriptManager ,如果在页面中使用多个控件,则不要多次包含相同的文件/ js部分。
Or use ScriptManager in the code behind so you don't include the same file/js section multiple times if you use multiple controls in a page.
您可以找到更多关于 ScriptManager
这里(概述,包括使用场景)。
You can find out more about ScriptManager
here (overview, including usage scenarios).
这篇关于如何在.ascx页面中使用javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文