Beispiel #1
0
        public static void RegisterTooltipScript(System.Web.UI.Page page, int borderWidth,
                                                 string borderColor, int padding, string backgroundColor)
        {
            if (page.Page.ClientScript.IsClientScriptBlockRegistered("gfx_tooltip"))
            {
                return;
            }

            AssemblyResourceHandler.RegisterScript(page, "Tooltip.js");

            page.Page.ClientScript.RegisterStartupScript(typeof(ControlExtender), "gfx_tooltip_start",
                                                         "<style type=\"text/css\">\r\n" +
                                                         "#dhtmltooltip{ position: absolute; width: 150px; " +
                                                         "border: " + borderWidth.ToString() + "px solid " + borderColor + @";" +
                                                         "padding: " + padding.ToString() + @"px;" +
                                                         "background-color: " + backgroundColor + @";" +
                                                         "visibility: hidden;" +
                                                         "z-index: 200;" + /*Remove below line to remove shadow. Below line should always appear last within this CSS*/
                                                         "filter: progid:DXImageTransform.Microsoft.dropShadow(Color=999999,offX=2,offY=2,positive=true);" +
                                                         "} </style>\r\n" +
                                                         "<script language=\"javascript\">\r\n" +
                                                         "if (ie4 || ns6)\r\n" +
                                                         "var tipobj = document.all ? document.all[\"dhtmltooltip\"] : document.getElementById ? document.getElementById(\"dhtmltooltip\") : \"\";" +
                                                         "</script>");

            page.Page.ClientScript.RegisterClientScriptBlock(typeof(ControlExtender), "gfx_tooltip_div", "<div id=\"dhtmltooltip\"></div>");
        }
Beispiel #2
0
        /// <summary>
        /// Registers client scripts for GreyFox Webcontrols using Resource Manifest.
        /// </summary>
        /// <param name="scriptName"></param>
        protected void RegisterClientScript(string scriptName)
        {
            // BE SURE TO REGISTER BASE.JS FIRST!
            if (scriptName != "Base.js")
            {
                AssemblyResourceHandler.RegisterScript(this.Page, "Base.js");
            }

            AssemblyResourceHandler.RegisterScript(this.Page, scriptName);
        }
Beispiel #3
0
        public void RegisterClientScriptBlock(Control parentControl)
        {
            AssemblyResourceHandler.RegisterScript(parentControl.Page, "Tabstrip.js");

            StringBuilder tabArray = new StringBuilder();

            for (int x = 0; x < _tabs.Count; x++)
            {
                tabArray.Append("\"");
                tabArray.Append(_tabs[x].Name);
                tabArray.Append("\"");
                if (x < _tabs.Count - 1)
                {
                    tabArray.Append(",");
                }
            }

            parentControl.Page.ClientScript.RegisterArrayDeclaration(parentControl.ID + "_Tabs", tabArray.ToString());
        }
Beispiel #4
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (_mode == MultiSelectBoxMode.DualSelect)
            {
                AssemblyResourceHandler.RegisterScript(this.Page, "SelectBox.js");
                AssemblyResourceHandler.RegisterScript(this.Page, "OptionTransfer.js");

                Page.ClientScript.RegisterStartupScript(this.GetType(), "gfx_ms_" + ClientID,
                                                        "<script language=\"javascript\"> \r\n" +
                                                        "var " + ClientID + "_ot = new OptionTransfer(\"" + ClientID + "_a\", \"" + ClientID + "_b\"); \r\n" +
                                                        ClientID + "_ot.setAutoSort(" + _autoSort.ToString().ToLower() + "); \r\n" +
                                                        ClientID + "_ot.setDelimiter(\"" + _delimeter + "\"); \r\n" +
                                                        ClientID + "_ot.saveNewRightOptions(\"" + UniqueID + "\"); \r\n" +
                                                        ClientID + "_ot.init(document.forms[0]); \r\n" +
                                                        "</script>");

                Page.ClientScript.RegisterHiddenField(UniqueID, string.Empty);
            }

            if (_mode == MultiSelectBoxMode.CheckBoxList)
            {
                // BUG FIX FOR LoadPostData not firing on no selection!
                Page.ClientScript.RegisterHiddenField(UniqueID, "1");

//				System.Text.StringBuilder s = new System.Text.StringBuilder();
//				for(int x = 0; x < Items.Count - 1; x++)
//				{
//					s.Append(Items[x].Value);
//					s.Append(";");
//				}
//				s.Append(Items[Items.Count - 1]);
//				Page.ClientScript.RegisterHiddenField(UniqueID + "_values", s.ToString());
            }
        }
Beispiel #5
0
 public void RegisterClientScriptBlock(Control parentControl)
 {
     AssemblyResourceHandler.RegisterScript(parentControl.Page, "Toolbar.js");
 }