Developing With Sitefinity When A Different Version of OpenAccess is Installed

One of the best features of Sitefinity is the inclusion of the fantastic ORM tool OpenAccess. However, one issue that can be a bit troublesome is the fact that Sitefinity has often shipped with a different version of OpenAccess that the latest.

Fortunately, It is possible to work around this problem, with a little help from the OpenAccess product archive and an MSI extractor.

Get the Url of a Sitefinity Page from the Guid

If you are working with the Sitefinity Pages API you can easily retrieve the Id of any page in the system. You might also be working with a custom or intra-site module, which has a static Guid property for the landing page.

Fortunately, there is an extension method in the Telerik.Sitefinity.Modules.Pages that can return the actual full url to the page.

Add Control to Sitefinity Page with Default Permissions

When adding controls to a Sitefinity page programmatically, by default it’s going to set restricted permissions so that only users in the Administrators role can view them.

You can easily change this so that the widget is installed with the default permissions it would get by being dragged onto the page with the following code:

Including CSS in a Sitefinity User Control

When working with Sitefinity Intra-Site Modules, all your module’s logic, code, and markup is contained in User Controls. This allows you to inherit all the styles from the default Sitefinity backend theme.

However you might want to add additional styling to your admin controls. You can accomplish this easily by adding a custom stylesheet for admin controls and referencing them from the user controls. Simply add the following code to each control’s frontend ascx file.