More in this section
Forums / Bugs & Issues / how to change page theme at runtime without login using cookies

how to change page theme at runtime without login using cookies

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. saqib
    saqib avatar
    22 posts
    23 Nov 2007
    01 Feb 2011
    Link to this post
    Hi ,

    User want to change theme of page at runtime without login. Currently following function is available to change the page theme at  runtime but it works only if user is login.

      var manager = Telerik.Sitefinity.Modules.Pages.PageManager.GetManager();
                SiteMapNode currentNode = Telerik.Sitefinity.Web.SiteMapBase.GetCurrentProvider().CurrentNode;
                Guid pageId = ((PageSiteNode)currentNode).PageId;
                var draft = manager.EditPage(pageId, true);
                draft.Theme = DropDownList1.SelectedValue;
                manager.PublishPageDraft(draft.Id, true);

    But i want to change the page theme without login. i am using sitefinity 4.0. Please guide me in detail because there is no much help is available for SiteAffinity4.0.

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    03 Feb 2011
    Link to this post
    Hello saqib,

    You can use manager.Provider.SuppressSecurityChecks = true; when you get the manager. Then you will not be required to authenticate.

    Best wishes,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered