ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 注册客户端事件

注册客户端事件

原创 Linux操作系统 作者:CodeAgriculture 时间:2013-09-22 11:47:52 0 删除 编辑

        ///

        /// 注册客户端CSS文件

        ///

        ///

        ///

        public static void RegisterClientCSSFile(Page page, string relativeURL)

        {

            relativeURL = page.ResolveUrl(relativeURL);

            page.Header.Controls.Add(new LiteralControl("\n + relativeURL + "\" rel=\"stylesheet\" type=\"text/css\">\n"));

        }

        ///

        /// 退

        ///

        ///

        ///

        /// 秒为单?

        public static void ClosePage(Page page, string script, int delayTime)

        {

            string closeScript. = "";

            closeScript. += "";

            closeScript. += "setTimeout(\"ClosePage()\","+ (delayTime * 1000).ToString()+");";

            closeScript. += "function ClosePage(){window.close();"+script+"};";

            closeScript. += "";

 

            page.ClientScript.RegisterClientScriptBlock(page.GetType(), "ClosePage",

                closeScript);

        }

        ///

        ///

        /// Creator: Create Time:2009/7/22 13:47:20

        ///

        ///

        ///

        ///

        public static void RegisterClientScriptFile(Page page, string key, string relativeURL)

        {

            relativeURL = page.ResolveUrl(relativeURL);

            if (!page.ClientScript.IsClientScriptIncludeRegistered(key))

            {

                page.ClientScript.RegisterClientScriptInclude(key, relativeURL);

            }

        }

 

        ///

        ///

        ///

        ///

        public static void AutoBreakWord(WebControl control)

        {

            if (control != null)

            {

                control.Style.Add("word-break", "break-all");

            }

        }

        ///

        ///

        ///

        ///

        public static void DisablePaste(WebControl control)

        {

            if (control != null)

            {

                control.Attributes.Add("onpaste", "event.returnValue=false;");

            }

        }

        ///

        ///

        ///

        ///

        public static void DisableKeyDown(WebControl control)

        {

            if (control != null)

            {

                control.Attributes.Add("onkeydown", "event.returnValue=false;");

            }

        }

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28699126/viewspace-772958/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Develop
下一篇: CollectionsConvertor
请登录后发表评论 登录
全部评论

注册时间:2013-03-07

  • 博文量
    54
  • 访问量
    413096