Inheritance: System.Web.UI.WebControls.WebControl
Exemple #1
0
        protected override void RenderContents(HtmlTextWriter output)
        {
            int ident = output.Indent;

            string sJSFile = BaseWebControl.GetWebResourceUrl(this.GetType(), "Carrotware.Web.UI.Controls.jsHelperLibrary.js");
            string sJQFile = BaseWebControl.GetWebResourceUrl(this.GetType(), "Carrotware.Web.UI.Controls.jquery-1-8-3.js");

            output.Indent = ident + 3;
            output.WriteLine();
            output.WriteLine("<!-- Javascript Helper Functions BEGIN -->");
            output.WriteLine("<script src=\"" + sJSFile + "\" type=\"text/javascript\"></script> ");

            if (LoadJQueryAsServerControl)
            {
                this.Page.Header.Controls.AddAt(0, new jquery());
            }
            else
            {
                output.WriteLine("<script type=\"text/javascript\">__carrotware_SetJQueryURL('" + sJQFile + "');</script> ");
            }

            output.WriteLine("<!-- Javascript Helper Functions END -->");
            output.WriteLine();

            output.Indent = ident;
        }
Exemple #2
0
        private void imgBool_DataBinding(object sender, EventArgs e)
        {
            Image       imgBool   = (Image)sender;
            GridViewRow container = (GridViewRow)imgBool.NamingContainer;

            imgBool.ImageUrl = HttpUtility.HtmlEncode(BaseWebControl.GetWebResourceUrl(imgBool.Page, this.GetType(), CarrotBooleanImageItemTemplate.IconResourcePaperclip));

            try {
                bool bValue = Convert.ToBoolean(DataBinder.Eval(container, "DataItem." + _field).ToString());

                if (bValue)
                {
                    imgBool.ImageUrl      = _imageTrue;
                    imgBool.AlternateText = _verbiageTrue;
                }
                else
                {
                    imgBool.ImageUrl      = _imageFalse;
                    imgBool.AlternateText = _verbiageFalse;
                }
                imgBool.ToolTip = imgBool.AlternateText;
            } catch {
                imgBool.AlternateText = _field;
                imgBool.ToolTip       = _field;
            }
        }
Exemple #3
0
        private void imgEnum_DataBinding(object sender, EventArgs e)
        {
            Image       imgEnum   = (Image)sender;
            GridViewRow container = (GridViewRow)imgEnum.NamingContainer;

            imgEnum.ImageUrl = HttpUtility.HtmlEncode(BaseWebControl.GetWebResourceUrl(imgEnum.Page, this.GetType(), CarrotBooleanImageItemTemplate.IconResourcePaperclip));

            try {
                string sValue = DataBinder.Eval(container, "DataItem." + _field).ToString();

                CarrotImageColumnData img = (from i in _images
                                             where i.KeyValue.ToLowerInvariant() == sValue.ToLowerInvariant()
                                             select i).FirstOrDefault();
                if (img != null)
                {
                    imgEnum.ImageUrl      = img.ImagePath;
                    imgEnum.AlternateText = img.ImageAltText;
                }
                else
                {
                    imgEnum.AlternateText = "[" + _field + "] IMAGE DEF MISSING";
                }
                imgEnum.ToolTip = imgEnum.AlternateText;
            } catch {
                imgEnum.AlternateText = _field;
                imgEnum.ToolTip       = _field;
            }
        }
Exemple #4
0
 public static string GetWebResourceUrl(string resource)
 {
     return(BaseWebControl.GetWebResourceUrl(typeof(jquerybasic), resource));
 }
Exemple #5
0
 public void SetImage()
 {
     _imageTrue  = HttpUtility.HtmlEncode(BaseWebControl.GetWebResourceUrl(this.GetType(), CarrotBooleanImageItemTemplate.IconResourceAffirm));
     _imageFalse = HttpUtility.HtmlEncode(BaseWebControl.GetWebResourceUrl(this.GetType(), CarrotBooleanImageItemTemplate.IconResourceNegative));
 }