Using the PortalSettings class in containers
It’s simple, but useful: If you try to use the PortalSettings class in code you have added to a container’s .ascx file, you’ll find out that you can’t. The PortalSettings shared class is only directly accessible from skins.
That’s dissapointing, especially when you need to grab things like, for example, the current tab id (PortalSettings.ActiveTab.TabId) inside a container for some reeson.
The solution to this is to grab your PortalSettings contents from the HttpContext and use it like this:
Dim _portalSettings As PortalSettings
_portalSettings = CType( _
HttpContext.Current.Items("PortalSettings") _
, PortalSettings)
</script>
In order to get, for example, the current tab id from your container, you can now use _portalSettings.ActiveTab.Tabid.
1 comments:
thanks a lot
Post a Comment