当前位置: 首页>>代码示例>>C#>>正文


C# Page.Engine方法代码示例

本文整理汇总了C#中System.Web.UI.Page.Engine方法的典型用法代码示例。如果您正苦于以下问题:C# Page.Engine方法的具体用法?C# Page.Engine怎么用?C# Page.Engine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.Page的用法示例。


在下文中一共展示了Page.Engine方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: JavaScript

        /// <summary>Registers a script block on a page.</summary>
        /// <param name="page">The page onto which to added the script.</param>
        /// <param name="script">The script to add.</param>
        /// <param name="position">Where to add the script.</param>
        /// <param name="options">Script registration options.</param>
        public static void JavaScript(Page page, string script, ScriptPosition position, ScriptOptions options)
        {
            if (page == null) throw new ArgumentNullException("page");

            if (position == ScriptPosition.Header)
            {
                JavaScript(page, script, options);
            }
            else if (position == ScriptPosition.Bottom)
            {
                string key = script.GetHashCode().ToString();
                if (Is(options, ScriptOptions.None))
                    page.ClientScript.RegisterClientScriptBlock(typeof (Register), key, script);
                else if (Is(options, ScriptOptions.ScriptTags))
                    page.ClientScript.RegisterClientScriptBlock(typeof (Register), key, script, true);
                else if (Is(options, ScriptOptions.DocumentReady))
                {
                    JQuery(page);
                    page.ClientScript.RegisterClientScriptBlock(typeof (Register), key, EmbedDocumentReady(script), true);
                }
                else if (Is(options, ScriptOptions.Include))
                    page.ClientScript.RegisterClientScriptInclude(key, page.Engine().ManagementPaths.ResolveResourceUrl(script));
                else
                    throw new ArgumentException("options");
            }
            else
                throw new ArgumentException("position");
        }
开发者ID:spmason,项目名称:n2cms,代码行数:33,代码来源:Register.cs

示例2: AddScriptInclude

        private static Control AddScriptInclude(Page page, string resourceUrl, Control holder, bool priority)
        {
            if (page == null) throw new ArgumentNullException("page");

            HtmlGenericControl script = new HtmlGenericControl("script");
            page.Items[resourceUrl] = script;

            resourceUrl = page.Engine().ManagementPaths.ResolveResourceUrl(resourceUrl);

            script.Attributes["src"] = resourceUrl;
            script.Attributes["type"] = "text/javascript";
            if(priority)
                holder.Controls.AddAt(0, script);
            else
                holder.Controls.Add(script);

            return script;
        }
开发者ID:sergheizagaiciuc,项目名称:n2cms,代码行数:18,代码来源:Register.cs

示例3: TinyMCE

 public static void TinyMCE(Page page)
 {
     JavaScript(page, page.Engine().ManagementPaths.ResolveResourceUrl("{ManagementUrl}/Resources/tiny_mce/tiny_mce.js"));
 }
开发者ID:sergheizagaiciuc,项目名称:n2cms,代码行数:4,代码来源:Register.cs

示例4: TabPanel

        public static void TabPanel(Page page, string selector, bool registerTabCss)
        {
            var key = "N2.Resources.TabPanel" + selector;
            if (page.Items[key] == null)
            {
                JQuery(page);
                JQueryPlugins(page);

                string script = string.Format(tabPanelFormat, selector, selector.Replace('.', '_'));
                JavaScript(page, script, ScriptOptions.DocumentReady);
                page.Items[key] = new object();
                if (registerTabCss)
                {
                    StyleSheet(page, page.Engine().ManagementPaths.ResolveResourceUrl("{ManagementUrl}/Resources/Css/TabPanel.css"));
                }
            }
        }
开发者ID:sergheizagaiciuc,项目名称:n2cms,代码行数:17,代码来源:Register.cs

示例5: StyleSheet

        /// <summary>Register a style sheet reference in the page's header with media type.</summary>
        /// <param name="page">The page onto which to register the style sheet.</param>
        /// <param name="resourceUrl">The url to the style sheet to register.</param>
        /// <param name="media">The media type to assign, e.g. print.</param>
        public static void StyleSheet(Page page, string resourceUrl, Media media)
        {
            if (page == null) throw new ArgumentNullException("page");
            if (resourceUrl == null) throw new ArgumentNullException("resourceUrl");

            resourceUrl = N2.Web.Url.ToAbsolute(resourceUrl);

            if (page.Items[resourceUrl] == null)
            {
                PlaceHolder holder = GetPlaceHolder(page);

                HtmlLink link = new HtmlLink();
                link.Href = page.Engine().ManagementPaths.ResolveResourceUrl(resourceUrl);
                link.Attributes["type"] = "text/css";
                link.Attributes["media"] = media.ToString().ToLower();
                link.Attributes["rel"] = "stylesheet";
                holder.Controls.Add(link);

                page.Items[resourceUrl] = null;
            }
        }
开发者ID:sergheizagaiciuc,项目名称:n2cms,代码行数:25,代码来源:Register.cs

示例6: JQueryPlugins

 public static void JQueryPlugins(Page page)
 {
     JQuery(page);
     JavaScript(page, page.Engine().ManagementPaths.ResolveResourceUrl("{ManagementUrl}/Resources/Js/plugins.ashx?v=" + typeof(Register).Assembly.GetName().Version));
 }
开发者ID:spmason,项目名称:n2cms,代码行数:5,代码来源:Register.cs


注:本文中的System.Web.UI.Page.Engine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。