public static void InsertjQuery(Page thePage)
        {
            bool bFoundjQuery = false;
            //jquery jq = null;
            //jqueryui jqui = null;
            jquerybasic jquerybasic2 = new jquerybasic();

            jquerybasic2.SelectedSkin = jquerybasic.jQueryTheme.NotUsed;

            foreach (var c in thePage.Header.Controls)
            {
                //if (c is jquery && !bFoundjQuery) {
                //    jq = (jquery)c;
                //    if (jq.JQVersion.ToLowerInvariant() == (new jquery()).JQVersion) {
                //        bFoundjQuery = true;
                //    }
                //}
                //if (c is jqueryui) {
                //    jqui = (jqueryui)c;
                //}
                if (c is jquerybasic)
                {
                    jquerybasic2 = (jquerybasic)c;
                    bFoundjQuery = true;
                    break;
                }
            }

            //if (bFoundjQuery) {
            //    if (jq != null) {
            //        thePage.Header.Controls.Remove(jq);
            //    }
            //}

            //if (jqui != null) {
            //    (new PlaceHolder()).Controls.Add(jqui);
            //}

            //(new PlaceHolder()).Controls.Add(jquerybasic2);

            if (!bFoundjQuery)
            {
                thePage.Header.Controls.AddAt(0, jquerybasic2);
            }
            else
            {
                if (jquerybasic2.StylesheetOnly)
                {
                    jquerybasic jb1 = new jquerybasic();
                    jb1.SelectedSkin = jquerybasic.jQueryTheme.NotUsed;
                    thePage.Header.Controls.AddAt(0, jb1);
                }
            }
        }
Example #2
0
        public static jquerybasic FindjQuery(Page thePage)
        {
            jquerybasic jquerybasic2 = new jquerybasic();
            jquerybasic2.SelectedSkin = jquerybasic.jQueryTheme.NotUsed;

            foreach (var c in thePage.Header.Controls) {
                if (c is jquerybasic) {
                    jquerybasic2 = (jquerybasic)c;
                    break;
                }
            }

            return jquerybasic2;
        }
Example #3
0
        public static void InsertjQuery(Page thePage)
        {
            bool bFoundjQuery = false;
            //jquery jq = null;
            //jqueryui jqui = null;
            jquerybasic jquerybasic2 = new jquerybasic();
            jquerybasic2.SelectedSkin = jquerybasic.jQueryTheme.NotUsed;

            foreach (var c in thePage.Header.Controls) {
                //if (c is jquery && !bFoundjQuery) {
                //    jq = (jquery)c;
                //    if (jq.JQVersion.ToLower() == (new jquery()).JQVersion) {
                //        bFoundjQuery = true;
                //    }
                //}
                //if (c is jqueryui) {
                //    jqui = (jqueryui)c;
                //}
                if (c is jquerybasic) {
                    jquerybasic2 = (jquerybasic)c;
                    bFoundjQuery = true;
                    break;
                }
            }

            //if (bFoundjQuery) {
            //    if (jq != null) {
            //        thePage.Header.Controls.Remove(jq);
            //    }
            //}

            //if (jqui != null) {
            //    (new PlaceHolder()).Controls.Add(jqui);
            //}

            //(new PlaceHolder()).Controls.Add(jquerybasic2);

            if (!bFoundjQuery) {
                thePage.Header.Controls.AddAt(0, jquerybasic2);
            } else {
                if (jquerybasic2.StylesheetOnly) {
                    jquerybasic jb1 = new jquerybasic();
                    jb1.SelectedSkin = jquerybasic.jQueryTheme.NotUsed;
                    thePage.Header.Controls.AddAt(0, jb1);
                }
            }
        }
        public static jquerybasic FindjQuery(Control control)
        {
            jquerybasic jquerybasic1 = null;

            if (control is Page)
            {
                Page thePage = (Page)control;
                foreach (Control c in thePage.Header.Controls)
                {
                    if (c is jquerybasic)
                    {
                        jquerybasic1 = (jquerybasic)c;
                        break;
                    }
                    else
                    {
                        jquerybasic1 = FindjQuery(c);
                        if (jquerybasic1 != null)
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                foreach (Control c in control.Controls)
                {
                    if (c is jquerybasic)
                    {
                        jquerybasic1 = (jquerybasic)c;
                        break;
                    }
                    else
                    {
                        jquerybasic1 = FindjQuery(c);
                        if (jquerybasic1 != null)
                        {
                            break;
                        }
                    }
                }
            }

            return(jquerybasic1);
        }