protected void CalendarControl_DayRender(object sender, DayRenderEventArgs e)
        {
            var scm = ScriptManager.GetCurrent(Page);

            if (scm != null && scm.IsInAsyncPostBack)
            {
                return;
            }

            e.Day.IsSelectable = HasEvent(e.Day.Date);

            var addLink = new ActionLinkButton
            {
                ActionName      = "Add",
                NodePath        = ContextNode.Path,
                ParameterString = "StartDate=" + e.Day.Date + ";ContentTypeName=CalendarEvent",
                IconVisible     = false,
                Text            = HttpContext.GetGlobalResourceObject("Renderers", "Add") as string,
                ToolTip         = (HttpContext.GetGlobalResourceObject("Renderers", "AddNewEvent") as string) + e.Day.Date.ToString("MMMM dd")
            };

            e.Cell.Controls.Add(addLink);
        }
예제 #2
0
        protected string EvaluateActionLinkButton(string templateName, string templateExpression, ActionLinkButton alButton)
        {
            var action = alButton.Action;

            var clientAction = action as ClientAction;

            if (clientAction != null)
            {
                switch (templateName)
                {
                case "onclick":
                    return(string.Format(OnClickFormat, clientAction.Callback));

                case "url":
                    return("javascript:");
                }
            }

            switch (templateName)
            {
            case "name":
                return(action.Name);

            case "url":
                return(action.Forbidden ? string.Empty : action.Uri);

            case "text":
                return(string.IsNullOrEmpty(alButton.Text) ? action.Text : alButton.Text);

            case "title":
                return(alButton.ToolTip);

            case "class":
                return(alButton.CssClass);

            case "disabled":
                return(alButton.Enabled ? string.Empty : "disabled");

            case "iconname":
                return(alButton.IconName.ToLowerInvariant());

            case "iconurl":
                return(alButton.IconUrl);

            case "iconsize":
                return(alButton.IconSize.ToString());

            case "iconsizeclass":
                return("sn-icon" + alButton.IconSize);

            case "overlay":
                return(alButton.Overlay);

            case "overlayclass":
                return(string.IsNullOrEmpty(alButton.Overlay) ? string.Empty : "sn-overlay-" + alButton.Overlay);
            }

            return(string.Empty);
        }