有和没有runat = server属性的脚本标签之间有什么区别 [英] What is the difference between a script tag with and without a runat=server attribute
本文介绍了有和没有runat = server属性的脚本标签之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<script runat="server">
和<script>
有什么区别?
推荐答案
添加runat="server"
属性后,该标签将像其他任何asp.net
控件一样在服务器端代码中可用.
When you add runat="server"
attribute the tag will become available in server side code like any other asp.net
control.
然后,您将可以直接在块中操作/添加c#/javascript代码.
Then you will be able to manipulate/add c#/javascript code within the blocks directly.
如果不添加runat
属性,则只能使用客户端脚本.
If you don't add the runat
attribute you will be able to only have client side scripting.
这篇关于有和没有runat = server属性的脚本标签之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文