.aspx页面中的Javascript

编程入门 行业动态 更新时间:2024-10-28 14:35:11
本文介绍了.aspx页面中的Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在主页和内容页面中添加JavaScript?

How to add JavaScript in a masterpage and content page?

推荐答案

在主页中 应该在< header>中标签 在内容页面中,它应该在下面 < asp:contentplaceholder xmlns:asp =#unknown"> tag</asp:contentplaceholder></header> in master page should be in <header> tag in content page it should be below <asp:contentplaceholder xmlns:asp="#unknown"> tag</asp:contentplaceholder></header>

只需在母版页或内容页中添加脚本标签,然后就可以在其中包含javascript. 例如: Just add the script tags in the master page or content page and the javascripts can be included in them. Eg: <script> // My Javascripts here! </script> <form> <!-- Master Page--> </form>

如果要向它们添加JavaScript文件,则可以在script标记中使用 src 属性. 最后,请选择任何基础书籍,先阅读然后开始编码!

If you want to add a JavaScript file to them, you can use src attribute in the script tag. Lastly, please pick any basic book, read first and then start coding!

在母版页中,javascript功能必须位于脚本标记下的头部. < head>< script type ="text/javascript" language ="javascript"> //javascript代码在这里 </script></head> 在内容页面中,javascript代码可以位于具有contentplaceholderid作为头部的content标记中,也可以在母版页中作为母版页标题部分中的contentplaceholder出现在内容标签中. In a master page the javascript functionality must be there in head section under script tag. <head><script type="text/javascript" language="javascript"> //javascript code goes here </script></head> In the content pages, The javascript code can be in content tag which has contentplaceholderid as head which is also there in master page as contentplaceholder in head section of master page.

更多推荐

.aspx页面中的Javascript

本文发布于:2023-11-11 11:40:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578339.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页面   aspx   Javascript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!