当前位置: 首页>>代码示例>>C#>>正文


C# CMSAdminControl.SetValue方法代码示例

本文整理汇总了C#中CMSAdminControl.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# CMSAdminControl.SetValue方法的具体用法?C# CMSAdminControl.SetValue怎么用?C# CMSAdminControl.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMSAdminControl的用法示例。


在下文中一共展示了CMSAdminControl.SetValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Init

    protected void Page_Init(object sender, EventArgs e)
    {
        // Check license
        if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, "") != "")
        {
            LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.Polls);
        }

        // Check site availability
        if (!ResourceSiteInfoProvider.IsResourceOnSite("CMS.Polls", SiteContext.CurrentSiteName))
        {
            RedirectToResourceNotAvailableOnSite("CMS.Polls");
        }

        // Check site availability
        if (!ResourceSiteInfoProvider.IsResourceOnSite("CMS.Form", SiteContext.CurrentSiteName))
        {
            RedirectToResourceNotAvailableOnSite("CMS.Form");
        }

        var user = MembershipContext.AuthenticatedUser;

        // Check permissions for CMS Desk -> Tools -> Polls
        if (!user.IsAuthorizedPerUIElement("CMS.Polls", "Polls"))
        {
            RedirectToUIElementAccessDenied("CMS", "Polls");
        }

        // Check permissions for site polls
        if (!user.IsAuthorizedPerResource("CMS.Polls", CMSAdminControl.PERMISSION_READ))
        {
            RedirectToAccessDenied("CMS.Polls", "Read");
        }

        // Check permissions for forms
        if (!user.IsAuthorizedPerResource("CMS.Form", "ReadData"))
        {
            RedirectToAccessDenied("CMS.Form", "ReadData");
        }

        // Load BizForm selector if BizForms module is available
        if (ModuleManager.IsModuleLoaded(ModuleName.BIZFORM) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleName.BIZFORM, SiteContext.CurrentSiteName))
        {
            bizFormData = this.LoadUserControl("~/CMSModules/BizForms/Controls/BizFormEditData.ascx") as CMSAdminControl;
            bizFormData.ShortID = "bizFormData";
            bizFormData.SetValue("ShowNewRecordButton", false);
            plcBizForm.Controls.Add(bizFormData);
            bizFormData.Visible = true;
        }
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:50,代码来源:Polls_Answer_Results.aspx.cs

示例2: SetupControl

    protected void SetupControl()
    {
        // Get current user if UserID is not defined
        int userId = UserID;
        if ((userId <= 0) && (CMSContext.CurrentUser != null))
        {
            userId = CMSContext.CurrentUser.UserID;
        }

        // Use current site if SiteID is not defined
        int siteId = SiteID;
        if (siteId <= 0)
        {
            siteId = CMSContext.CurrentSiteID;
        }
        string siteName = SiteInfoProvider.GetSiteName(siteId);

        bool firstInserted = false;

        // Try to init newsletters subscriptions
        if (ShowNewsletters && ModuleEntry.IsModuleLoaded(ModuleEntry.NEWSLETTER))
        {
            ucNewsletters = Page.LoadControl("~/CMSModules/Newsletters/Controls/MySubscriptions.ascx") as CMSAdminControl;
            if (ucNewsletters != null)
            {
                pnlNewsletters.Visible = true;
                pnlNewsletters.GroupingText = "&nbsp;" + GetString("Subscriptions.Newsletters") + "&nbsp;";
                ucNewsletters.ID = "ucNewsletters";
                ucNewsletters.SetValue("externaluse", true);
                ucNewsletters.SetValue("forcedvisible", true);
                ucNewsletters.SetValue("userid", userId);
                ucNewsletters.SetValue("siteid", siteId);
                ucNewsletters.SetValue("sendconfirmationemail", SendConfirmationMail);
                ucNewsletters.StopProcessing = StopProcessing;
                ucNewsletters.SetValue("islivesite", this.IsLiveSite);

                pnlNewsletters.Controls.Clear();
                pnlNewsletters.Controls.Add(new LiteralControl("<div class=\"SubscriptionsGroup\">"));
                pnlNewsletters.Controls.Add(ucNewsletters);
                pnlNewsletters.Controls.Add(new LiteralControl("</div>"));

                firstInserted = true;

                ucNewsletters.OnCheckPermissions += ucNewsletters_OnCheckPermissions;
            }
        }

        // Try to init blog post subscriptions
        if (ShowBlogs && ModuleEntry.IsModuleLoaded(ModuleEntry.BLOGS) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleEntry.BLOGS, siteName))
        {
            ucBlogs = Page.LoadControl("~/CMSModules/Blogs/Controls/BlogPostSubscriptions.ascx") as CMSAdminControl;
            if (ucBlogs != null)
            {
                pnlBlogs.Visible = true;
                pnlBlogs.GroupingText = "&nbsp;" + GetString("Subscriptions.BlogPosts") + "&nbsp;";
                ucBlogs.ID = "ucBlogs";
                ucBlogs.SetValue("userid", userId);
                ucBlogs.SetValue("siteid", siteId);
                ucBlogs.StopProcessing = StopProcessing;
                ucBlogs.OnCheckPermissions += ucBlogs_OnCheckPermissions;
                ucBlogs.SetValue("islivesite", this.IsLiveSite);

                if (firstInserted)
                {
                    pnlBlogs.Attributes.Add("class", "SubscriptionsPanel");
                }

                pnlBlogs.Controls.Clear();
                pnlBlogs.Controls.Add(new LiteralControl("<div class=\"SubscriptionsGroup\">"));
                pnlBlogs.Controls.Add(ucBlogs);
                pnlBlogs.Controls.Add(new LiteralControl("</div>"));

                firstInserted = true;
            }
        }

        // Try to init message board subscriptions
        if (ShowMessageBoards && ModuleEntry.IsModuleLoaded(ModuleEntry.MESSAGEBOARD) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleEntry.MESSAGEBOARD, siteName))
        {
            ucBoards = Page.LoadControl("~/CMSModules/MessageBoards/Controls/Boards/BoardUserSubscriptions.ascx") as CMSAdminControl;
            if (ucBoards != null)
            {
                pnlBoards.Visible = true;
                pnlBoards.GroupingText = "&nbsp;" + GetString("Subscriptions.MessageBoards") + "&nbsp;";
                ucBoards.ID = "ucBoards";
                ucBoards.SetValue("userid", userId);
                ucBoards.SetValue("siteid", siteId);
                ucBoards.StopProcessing = StopProcessing;
                ucBoards.OnCheckPermissions += ucBoards_OnCheckPermissions;
                ucBoards.SetValue("islivesite", this.IsLiveSite);

                if (firstInserted)
                {
                    pnlBoards.Attributes.Add("class", "SubscriptionsPanel");
                }
                pnlBoards.Controls.Clear();
                pnlBoards.Controls.Add(new LiteralControl("<div class=\"SubscriptionsGroup\">"));
                pnlBoards.Controls.Add(ucBoards);
                pnlBoards.Controls.Add(new LiteralControl("</div>"));
            }
//.........这里部分代码省略.........
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:101,代码来源:Subscriptions.ascx.cs

示例3: CreateChildControls


//.........这里部分代码省略.........
                    tabMenu.Tabs[i, 2] = HTMLHelper.HTMLEncode(URLHelper.AddParameterToUrl(absoluteUri, "tab", "projects"));
                    if (String.IsNullOrEmpty(defaultTab))
                    {
                        defaultTab = "projects";
                    }

                    projectTabIndex = i;
                }
            }
        }

        #endregion

        if (string.IsNullOrEmpty(page))
        {
            page = defaultTab;
            tabMenu.SelectedTab = 0;
        }

        // Select current page
        switch (page)
        {
            case "general":
                tabMenu.SelectedTab = generalTabIndex;

                // Show general content
                if (ShowGeneralTab)
                {
                    ctrl = LoadControl("~/CMSModules/Groups/Controls/GroupEdit.ascx") as CMSAdminControl;
                    ctrl.ID = "groupEditElem";

                    if (ctrl != null)
                    {
                        ctrl.SetValue("GroupID", gi.GroupID);
                        ctrl.SetValue("SiteID", CMSContext.CurrentSiteID);
                        ctrl.SetValue("IsLiveSite", this.IsLiveSite);
                        ctrl.SetValue("AllowChangeGroupDisplayName", AllowChangeGroupDisplayName);
                        ctrl.SetValue("AllowSelectTheme", AllowSelectTheme);
                        ctrl.OnCheckPermissions += new CheckPermissionsEventHandler(ctrl_OnCheckPermissions);
                        pnlContent.Controls.Add(ctrl);
                    }
                }
                break;

            case "security":
                tabMenu.SelectedTab = securityTabIndex;

                // Show security content
                if (ShowSecurityTab)
                {
                    ctrl = LoadControl("~/CMSModules/Groups/Controls/Security/GroupSecurity.ascx") as CMSAdminControl;
                    ctrl.ID = "securityElem";

                    if (ctrl != null)
                    {
                        ctrl.SetValue("GroupID", gi.GroupID);
                        ctrl.SetValue("IsLiveSite", this.IsLiveSite);
                        ctrl.OnCheckPermissions += new CheckPermissionsEventHandler(ctrl_OnCheckPermissions);
                        pnlContent.Controls.Add(ctrl);
                    }
                }
                break;

            case "members":
                if (membersTabIndex >= 0)
                {
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:67,代码来源:GroupProfile.ascx.cs

示例4: SetupControl

    protected void SetupControl()
    {
        // Get current user if UserID is not defined
        if (UserID <= 0)
        {
            UserID = CMSContext.CurrentUser.UserID;
        }

        // Use current site if SiteID is not defined
        if (SiteID <= 0)
        {
            SiteID = CMSContext.CurrentSiteID;
        }
        string siteName = SiteInfoProvider.GetSiteName(SiteID);

        bool firstInserted = false;

        // Try to init newsletters subscriptions
        if (ShowNewsletters && ModuleEntry.IsModuleLoaded(ModuleEntry.NEWSLETTER))
        {
            ucNewsletters = Page.LoadUserControl("~/CMSModules/Newsletters/Controls/MySubscriptions.ascx") as CMSAdminControl;
            if (ucNewsletters != null)
            {
                pnlNewsletters.Visible = true;
                pnlNewsletters.GroupingText = GetString("Subscriptions.Newsletters");
                ucNewsletters.ID = "ucNewsletters";
                ucNewsletters.SetValue("externaluse", true);
                ucNewsletters.SetValue("forcedvisible", true);
                ucNewsletters.SetValue("userid", UserID);
                ucNewsletters.SetValue("siteid", SiteID);
                ucNewsletters.SetValue("sendconfirmationemail", SendConfirmationMail);
                ucNewsletters.StopProcessing = StopProcessing;
                ucNewsletters.IsLiveSite = IsLiveSite;

                pnlNewsletters.Controls.Clear();
                pnlNewsletters.Controls.Add(new LiteralControl("<div class=\"SubscriptionsGroup\">"));
                pnlNewsletters.Controls.Add(ucNewsletters);
                pnlNewsletters.Controls.Add(new LiteralControl("</div>"));

                firstInserted = true;

                ucNewsletters.OnCheckPermissions += ucNewsletters_OnCheckPermissions;
            }
        }

        // Try to init blog post subscriptions
        if (ShowBlogs && ModuleEntry.IsModuleLoaded(ModuleEntry.BLOGS) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleEntry.BLOGS, siteName))
        {
            ucBlogs = Page.LoadUserControl("~/CMSModules/Blogs/Controls/BlogPostSubscriptions.ascx") as CMSAdminControl;
            if (ucBlogs != null)
            {
                pnlBlogs.Visible = true;
                pnlBlogs.GroupingText = GetString("Subscriptions.BlogPosts");
                ucBlogs.ID = "ucBlogs";
                ucBlogs.SetValue("userid", UserID);
                ucBlogs.SetValue("siteid", SiteID);
                ucBlogs.StopProcessing = StopProcessing;
                ucBlogs.OnCheckPermissions += ucBlogs_OnCheckPermissions;
                ucBlogs.IsLiveSite = IsLiveSite;

                if (firstInserted)
                {
                    pnlBlogs.Attributes.Add("class", "SubscriptionsPanel");
                }

                pnlBlogs.Controls.Clear();
                pnlBlogs.Controls.Add(new LiteralControl("<div class=\"SubscriptionsGroup\">"));
                pnlBlogs.Controls.Add(ucBlogs);
                pnlBlogs.Controls.Add(new LiteralControl("</div>"));

                firstInserted = true;
            }
        }

        // Try to init message board subscriptions
        if (ShowMessageBoards && ModuleEntry.IsModuleLoaded(ModuleEntry.MESSAGEBOARD) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleEntry.MESSAGEBOARD, siteName))
        {
            ucBoards = Page.LoadUserControl("~/CMSModules/MessageBoards/Controls/Boards/BoardUserSubscriptions.ascx") as CMSAdminControl;
            if (ucBoards != null)
            {
                pnlBoards.Visible = true;
                pnlBoards.GroupingText = GetString("Subscriptions.MessageBoards");
                ucBoards.ID = "ucBoards";
                ucBoards.SetValue("userid", UserID);
                ucBoards.SetValue("siteid", SiteID);
                ucBoards.StopProcessing = StopProcessing;
                ucBoards.OnCheckPermissions += ucBoards_OnCheckPermissions;
                ucBoards.IsLiveSite = IsLiveSite;

                if (firstInserted)
                {
                    pnlBoards.Attributes.Add("class", "SubscriptionsPanel");
                }
                pnlBoards.Controls.Clear();
                pnlBoards.Controls.Add(new LiteralControl("<div class=\"SubscriptionsGroup\">"));
                pnlBoards.Controls.Add(ucBoards);
                pnlBoards.Controls.Add(new LiteralControl("</div>"));
            }
        }

//.........这里部分代码省略.........
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:101,代码来源:Subscriptions.ascx.cs

示例5: SetupControl


//.........这里部分代码省略.........
                        }
                    }
                }

                if ((ucMyFriends == null) && DisplayMyFriends && ModuleEntry.IsModuleLoaded(ModuleEntry.COMMUNITY) && friendsEnabled)
                {
                    // Try to load the control dynamically (if available)
                    ucMyFriends = Page.LoadControl("~/CMSModules/Friends/Controls/MyFriends.ascx") as CMSAdminControl;
                    if (ucMyFriends != null)
                    {
                        ucMyFriends.ID = "ucMyFriends";
                        plcOther.Controls.Add(ucMyFriends);

                        tabName = friendsTab;
                        activeTabs.Add(tabName);
                        tabMenu.Tabs[activeTabs.IndexOf(tabName), 0] = GetString("MyAccount.MyFriends");
                        tabMenu.Tabs[activeTabs.IndexOf(tabName), 2] = HTMLHelper.HTMLEncode(URLHelper.AddParameterToUrl(absoluteUri, ParameterName, friendsTab));

                        if (selectedPage == string.Empty)
                        {
                            selectedPage = tabName;
                        }
                    }
                }

                if ((ucMyAllSubscriptions == null) && DisplayMySubscriptions)
                {
                    // Try to load the control dynamically (if available)
                    ucMyAllSubscriptions = Page.LoadControl("~/CMSModules/Membership/Controls/Subscriptions.ascx") as CMSAdminControl;
                    if (ucMyAllSubscriptions != null)
                    {
                        ucMyAllSubscriptions.Visible = false;

                        ucMyAllSubscriptions.SetValue("ShowBlogs", DisplayBlogs);
                        ucMyAllSubscriptions.SetValue("ShowMessageBoards", DisplayMessageBoards);
                        ucMyAllSubscriptions.SetValue("ShowNewsletters", DisplayNewsletters);
                        ucMyAllSubscriptions.SetValue("sendconfirmationemail", SendConfirmationEmails);

                        ucMyAllSubscriptions.ID = "ucMyAllSubscriptions";
                        plcOther.Controls.Add(ucMyAllSubscriptions);

                        tabName = subscriptionsTab;
                        activeTabs.Add(tabName);
                        tabMenu.Tabs[activeTabs.IndexOf(tabName), 0] = GetString("MyAccount.MyAllSubscriptions");
                        tabMenu.Tabs[activeTabs.IndexOf(tabName), 2] = HTMLHelper.HTMLEncode(URLHelper.AddParameterToUrl(absoluteUri, ParameterName, subscriptionsTab));

                        if (selectedPage == string.Empty)
                        {
                            selectedPage = tabName;
                        }
                    }
                }

                // My memberships
                if ((this.ucMyMemberships == null) && this.DisplayMyMemberships)
                {
                    // Try to load the control dynamically
                    this.ucMyMemberships = this.Page.LoadControl("~/CMSModules/Membership/Controls/MyMemberships.ascx") as CMSAdminControl;

                    if (this.ucMyMemberships != null)
                    {
                        this.ucMyMemberships.SetValue("UserID", currentUser.UserID);

                        if (!String.IsNullOrEmpty(this.MembershipsPagePath))
                        {
                            this.ucMyMemberships.SetValue("BuyMembershipURL", CMSContext.GetUrl(this.MembershipsPagePath));
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:67,代码来源:MyAccount.ascx.cs

示例6: SetupControl


//.........这里部分代码省略.........
                    // Try to load the control dynamically (if available)
                    ucMyFriends = Page.LoadUserControl("~/CMSModules/Friends/Controls/MyFriends.ascx") as CMSAdminControl;
                    if (ucMyFriends != null)
                    {
                        ucMyFriends.ID = "ucMyFriends";
                        plcOther.Controls.Add(ucMyFriends);

                        // Set new tab
                        tabName = friendsTab;
                        activeTabs.Add(tabName);
                        tabMenu.TabItems.Add(new TabItem()
                        {
                            Text = GetString("MyAccount.MyFriends"),
                            RedirectUrl = URLHelper.AddParameterToUrl(absoluteUri, ParameterName, friendsTab)
                        });

                        if (selectedPage == string.Empty)
                        {
                            selectedPage = tabName;
                        }
                    }
                }

                if ((ucMyAllSubscriptions == null) && DisplayMySubscriptions)
                {
                    // Try to load the control dynamically (if available)
                    ucMyAllSubscriptions = Page.LoadUserControl("~/CMSModules/Membership/Controls/Subscriptions.ascx") as CMSAdminControl;
                    if (ucMyAllSubscriptions != null)
                    {

                        // Set control
                        ucMyAllSubscriptions.Visible = false;

                        ucMyAllSubscriptions.SetValue("ShowBlogs", DisplayBlogs);
                        ucMyAllSubscriptions.SetValue("ShowMessageBoards", DisplayMessageBoards);
                        ucMyAllSubscriptions.SetValue("ShowNewsletters", DisplayNewsletters);
                        ucMyAllSubscriptions.SetValue("ShowForums", DisplayForums);
                        ucMyAllSubscriptions.SetValue("ShowReports", DisplayReports);
                        ucMyAllSubscriptions.SetValue("sendconfirmationemail", SendConfirmationEmails);

                        ucMyAllSubscriptions.ID = "ucMyAllSubscriptions";
                        plcOther.Controls.Add(ucMyAllSubscriptions);

                        // Set new tab
                        tabName = subscriptionsTab;
                        activeTabs.Add(tabName);
                        tabMenu.TabItems.Add(new TabItem()
                        {
                            Text = GetString("MyAccount.MyAllSubscriptions"),
                            RedirectUrl = URLHelper.AddParameterToUrl(absoluteUri, ParameterName, subscriptionsTab)
                        });

                        if (selectedPage == string.Empty)
                        {
                            selectedPage = tabName;
                        }
                    }
                }

                // My memberships
                if ((ucMyMemberships == null) && DisplayMyMemberships)
                {
                    // Try to load the control dynamically
                    ucMyMemberships = Page.LoadUserControl("~/CMSModules/Membership/Controls/MyMemberships.ascx") as CMSAdminControl;

                    if (ucMyMemberships != null)
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:67,代码来源:MyAccount.ascx.cs


注:本文中的CMSAdminControl.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。