zoukankan      html  css  js  c++  java
  • ASP.NET AJAX注册命名空间

    AJAX库支持命名空间的概念。 类可以分组到不同的命名空间。AJAX库会自动创建在此层次中不存在的任何级别的命名空间。

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ASPNETAJAXNamespaces.aspx.cs" Inherits="ASPNETAJAXNamespaces" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>ASP.NET AJAX Namespaces</title>
        <script type="text/javascript">
            function pageLoad(sender, args) {
                Type.registerNamespace('Wrox.AspAjax.Samples');
                alert(Type.isNamespace(Wrox.AspAjax)); //displays 'true'
                alert(Type.isNamespace(Wrox.AspAjax.Samples)); // displays 'false'
                var namespaces = Type.getRootNamespaces();
                for(var i = 0, length=namespaces.length; i<length; i++) {
                    alert(namespaces[i].getName()); // displays 'Sys' and 'Wrox'
    
                }
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        </div>
        </form>
    </body>
    </html>

     Type.getRootnamespaces()函数会得到全局命名空间组。

  • 相关阅读:
    react阻止默认事件
    react组件直接在document上添加事件
    react组件更新swiper
    react组件里阻事件冒泡
    react生命周期获取异步数据
    加油
    redis教程
    redis哨兵机制
    redis复制
    致自己
  • 原文地址:https://www.cnblogs.com/hellolong/p/3995192.html
Copyright © 2011-2022 走看看