コード例 #1
0
        protected override void OnPreRender(EventArgs e)
        {
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
                                                        "RoleMatrixEntryControlScript",
                                                        ResourceHelper.LoadStringFromResource(Assembly.GetExecutingAssembly(), "MCS.Web.WebControls.RoleMatrixEntry.RoleMatrixEntryControlScript.htm"),
                                                        false);

            AccessTicketHtmlAnchor.RegisterScript(this.Page);

            base.OnPreRender(e);
        }
コード例 #2
0
        private Control CreateLinkButton(string linkUrl, string prefix, string imgUrl, string title, string linkScript)
        {
            HtmlAnchor anchor = null;

            if (this.EnableAccessTicket)
            {
                anchor = new AccessTicketHtmlAnchor();

                anchor.ID = this.ClientID + prefix + "_anchor";
                if (linkScript.IsNotEmpty())
                {
                    ((AccessTicketHtmlAnchor)anchor).OnClientAccquiredAccessTicket = linkScript;
                }
            }
            else
            {
                anchor = new HtmlAnchor();

                if (linkScript.IsNotEmpty())
                {
                    anchor.Attributes["onclick"] = linkScript;
                }
            }

            anchor.HRef = linkUrl;
            anchor.Attributes["class"]           = "roleMatrixLink";
            anchor.Attributes["appCodeName"]     = this.AppCodeName;
            anchor.Attributes["appName"]         = this.AppName;
            anchor.Attributes["roleID"]          = this.RoleID;
            anchor.Attributes["appID"]           = this.AppID;
            anchor.Attributes["roleName"]        = this.RoleName;
            anchor.Attributes["roleCodeName"]    = this.RoleCodeName;
            anchor.Attributes["roleDescription"] = this.RoleDescription;
            anchor.Attributes["definitionID"]    = this.DefinitionID.IsNotEmpty() ? this.DefinitionID : this.RoleID;
            anchor.Attributes["readOnlyMode"]    = this.ReadOnly ? "enabled" : "disabled";

            HtmlImage img = new HtmlImage();

            img.Src = imgUrl;
            img.Alt = title;
            img.Attributes["class"] = "roleMatrixIcon";
            anchor.Controls.Add(img);

            return(anchor);
        }
コード例 #3
0
		private Control CreateLinkButton(string linkUrl, string prefix, string imgUrl, string title, string linkScript)
		{
			HtmlAnchor anchor = null;

			if (this.EnableAccessTicket)
			{
				anchor = new AccessTicketHtmlAnchor();

				anchor.ID = this.ClientID + prefix + "_anchor";
				if (linkScript.IsNotEmpty())
					((AccessTicketHtmlAnchor)anchor).OnClientAccquiredAccessTicket = linkScript;
			}
			else
			{
				anchor = new HtmlAnchor();

				if (linkScript.IsNotEmpty())
					anchor.Attributes["onclick"] = linkScript;
			}

			anchor.HRef = linkUrl;
			anchor.Attributes["class"] = "roleMatrixLink";
			anchor.Attributes["appCodeName"] = this.AppCodeName;
			anchor.Attributes["appName"] = this.AppName;
			anchor.Attributes["roleID"] = this.RoleID;
			anchor.Attributes["appID"] = this.AppID;
			anchor.Attributes["roleName"] = this.RoleName;
			anchor.Attributes["roleCodeName"] = this.RoleCodeName;
			anchor.Attributes["roleDescription"] = this.RoleDescription;
			anchor.Attributes["definitionID"] = this.DefinitionID.IsNotEmpty() ? this.DefinitionID : this.RoleID;
			anchor.Attributes["readOnlyMode"] = this.ReadOnly ? "enabled" : "disabled";

			HtmlImage img = new HtmlImage();

			img.Src = imgUrl;
			img.Alt = title;
			img.Attributes["class"] = "roleMatrixIcon";
			anchor.Controls.Add(img);

			return anchor;
		}