コード例 #1
0
        protected override void RenderContents(HtmlTextWriter output)
        {
            int ident = output.Indent;

            string sJSFile = WebControlHelper.GetWebResourceUrl(this.GetType(), "Carrotware.Web.UI.Controls.jsHelperLibrary.js");
            string sJQFile = WebControlHelper.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;
        }
コード例 #2
0
        private void imgEnum_DataBinding(object sender, EventArgs e)
        {
            Image       imgEnum   = (Image)sender;
            GridViewRow container = (GridViewRow)imgEnum.NamingContainer;

            imgEnum.ImageUrl = HttpUtility.HtmlEncode(WebControlHelper.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;
            }
        }
コード例 #3
0
        private void imgBool_DataBinding(object sender, EventArgs e)
        {
            Image       imgBool   = (Image)sender;
            GridViewRow container = (GridViewRow)imgBool.NamingContainer;

            imgBool.ImageUrl = HttpUtility.HtmlEncode(WebControlHelper.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;
            }
        }
コード例 #4
0
 public void SetImage()
 {
     _imageTrue  = HttpUtility.HtmlEncode(WebControlHelper.GetWebResourceUrl(this.GetType(), CarrotBooleanImageItemTemplate.IconResourceAffirm));
     _imageFalse = HttpUtility.HtmlEncode(WebControlHelper.GetWebResourceUrl(this.GetType(), CarrotBooleanImageItemTemplate.IconResourceNegative));
 }
コード例 #5
0
 public static string GetWebResourceUrl(string resource)
 {
     return(WebControlHelper.GetWebResourceUrl(typeof(jqueryui), resource));
 }
コード例 #6
0
 public string GetWebResourceUrl(Page page, Type type, string resource)
 {
     return(WebControlHelper.GetWebResourceUrl(page, type, resource));
 }